N°4667 - Remove call to tooltip function - change type of preview (fix seen with Guillaume)

This commit is contained in:
acognet
2022-03-21 15:14:30 +01:00
parent f93218a80f
commit 8204723b5b
2 changed files with 10 additions and 6 deletions

View File

@@ -1179,7 +1179,7 @@ class ObjectController extends BrickController
}
$aData['att_id'] = $iAttId;
$aData['preview'] = $oDocument->IsPreviewAvailable() ? 'true' : 'false';
$aData['preview'] = $oDocument->IsPreviewAvailable() ;
$aData['file_size'] = $oDocument->GetFormattedSize();
$aData['creation_date'] = $oAttachment->Get('creation_date');
$aData['user_id_friendlyname'] = $oAttachment->Get('user_id_friendlyname');

View File

@@ -183,7 +183,7 @@ JS
'{{iAttId}}',
'{{sLineStyle}}',
'{{sDocDownloadUrl}}',
'{{bHasPreview}}',
true,
'{{sAttachmentThumbUrl}}',
'{{sFileName}}',
'{{sAttachmentMeta}}',
@@ -214,7 +214,7 @@ JS
function UpdateAttachmentsCount(iIncrement)
{
var countContainer = $("a#$sCollapseTogglerId>span.attachments-count"),
iCountCurrentValue = parseInt(countContainer.text());
iCountCurrentValue = parseInt(countContainer.text());
countContainer.text(iCountCurrentValue+iIncrement);
}
@@ -246,20 +246,24 @@ JS
{search: "{{iAttId}}", replace:iAttId },
{search: "{{lineStyle}}", replace:'' },
{search: "{{sDocDownloadUrl}}", replace:sDownloadLink },
{search: "{{sHasPreview}}", replace:data.result.preview },
{search: "{{sAttachmentThumbUrl}}", replace:data.result.icon },
{search: "{{sFileName}}", replace: data.result.msg },
{search: "{{sAttachmentMeta}}", replace:sAttachmentMeta },
{search: "{{sFileSize}}", replace:data.result.file_size },
{search: "{{sAttachmentDate}}", replace:data.result.creation_date },
];
var sAttachmentRow = attachmentRowTemplate;
var sAttachmentRow = attachmentRowTemplate ;
$.each(replaces, function(indexInArray, value ) {
var re = new RegExp(value.search, 'gi');
sAttachmentRow = sAttachmentRow.replace(re, value.replace);
});
\$oAttachmentTBody.append(sAttachmentRow);
var oElem = $(sAttachmentRow);
if(!data.result.preview){
oElem.find('[data-tooltip-html-enabled="true"]').removeAttr('data-tooltip-content');
oElem.find('[data-tooltip-html-enabled="true"]').removeAttr('data-tooltip-html-enabled');
}
\$oAttachmentTBody.append(oElem);
// Remove button handler
$('#display_attachment_'+data.result.att_id+' :button').on('click', function(oEvent){
oEvent.preventDefault();