Ver Fonte

Dehardcoded the size of the attachments preview

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3343 a333f486-631f-4898-b8df-5754b55c2be0
romainq há 10 anos atrás
pai
commit
0738bafab3

+ 2 - 1
datamodels/2.x/itop-attachments/main.attachments.php

@@ -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)

+ 1 - 0
datamodels/2.x/itop-attachments/module.attachments.php

@@ -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,
 		),
 	)
 );