Dehardcoded the size of the attachments preview

SVN:trunk[3343]
This commit is contained in:
Romain Quetiez
2014-09-16 12:26:50 +00:00
parent 372c0835f7
commit 55c818b6b7
2 changed files with 3 additions and 1 deletions

View File

@@ -468,7 +468,8 @@ EOF
}
}
$sPreviewNotAvailable = addslashes(Dict::S('Attachments:PreviewNotAvailable'));
$oPage->add_ready_script("$(document).tooltip({ items: '.attachment a', position: { my: 'left top', at: 'right top', using: function( position, feedback ) { $( this ).css( position ); }}, content: function() { if ($(this).attr('data-preview') == 'true') { return('<img style=\"max-width:290px\" src=\"'+$(this).attr('href')+'\"></img>');} else { return '$sPreviewNotAvailable'; }}});");
$iMaxWidth = MetaModel::GetModuleSetting('itop-attachments', 'preview_max_width', 290);
$oPage->add_ready_script("$(document).tooltip({ items: '.attachment a', position: { my: 'left top', at: 'right top', using: function( position, feedback ) { $( this ).css( position ); }}, content: function() { if ($(this).attr('data-preview') == 'true') { return('<img style=\"max-width:{$iMaxWidth}px\" src=\"'+$(this).attr('href')+'\"></img>');} else { return '$sPreviewNotAvailable'; }}});");
}
protected static function UpdateAttachments($oObject, $oChange = null)

View File

@@ -64,6 +64,7 @@ SetupWebPage::AddModule(
'settings' => array(
'allowed_classes' => array('Ticket'), // List of classes for which to manage "Attachments"
'position' => 'relations', // Where to display the attachments: relations | properties
'preview_max_width' => 290,
),
)
);