Fix PHRAS-123 Fix tooltip content display

This commit is contained in:
Nicolas Le Goff
2014-05-22 14:48:58 +02:00
parent 7eb09ccabe
commit ab5f7d4492
3 changed files with 7 additions and 9 deletions

View File

@@ -103,12 +103,10 @@ class Tooltip implements ControllerProviderInterface
public function displayPreview(Application $app, $sbas_id, $record_id) public function displayPreview(Application $app, $sbas_id, $record_id)
{ {
$record = new \record_adapter($app, $sbas_id, $record_id); return $app['twig']->render('prod/Tooltip/Preview.html.twig', array(
'record' => new \record_adapter($app, $sbas_id, $record_id),
return $app['twig']->render( 'not_wrapped' => true
'prod/Tooltip/Preview.html.twig' ));
, array('record' => $record, 'not_wrapped' => true)
);
} }
public function displayCaption(Application $app, $sbas_id, $record_id, $context) public function displayCaption(Application $app, $sbas_id, $record_id, $context)

View File

@@ -1,8 +1,8 @@
<div class="popover" style="display:block;{% if maxwidth %}max-width:{{ maxwidth }}px;{% endif %}{% if width %}width:{{ width }}px;{% endif %}position:relative;"> <div class="popover" style="display:block;{% if maxwidth is not none %}max-width:{{ maxwidth }}px;{% endif %}{% if width is not none %}width:{{ width }}px;{% endif %}position:relative;">
<div class="arrow"></div> <div class="arrow"></div>
<div class="popover-inner" style="width:auto;"> <div class="popover-inner" style="width:auto;">
<h3 class="popover-title"> <h3 class="popover-title">
{% if title %} {% if title is not none %}
{{ title }} {{ title }}
{% endif %} {% endif %}
<button data-dismiss="modal" class="close tooltip_closer" style="display:none;">×</button> <button data-dismiss="modal" class="close tooltip_closer" style="display:none;">×</button>

View File

@@ -414,7 +414,7 @@
} }
if (resizeImgTips) { if (resizeImgTips) {
var factor = Math.min((width - 45) / width, (height - 75) / height); var factor = Math.max(Math.min((width - 45) / width, (height - 75) / height), 1);
var imgWidth = Math.round(width * factor); var imgWidth = Math.round(width * factor);
var imgHeight = Math.round(height * factor); var imgHeight = Math.round(height * factor);