Merge pull request #1084 from nlegoff/fix-phras-123

[3.8][PHRAS-123] Fix tooltip content display
This commit is contained in:
Nicolas Le Goff
2014-05-22 19:04:37 +02:00
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)
{
$record = new \record_adapter($app, $sbas_id, $record_id);
return $app['twig']->render(
'prod/Tooltip/Preview.html.twig'
, array('record' => $record, 'not_wrapped' => true)
);
return $app['twig']->render('prod/Tooltip/Preview.html.twig', array(
'record' => new \record_adapter($app, $sbas_id, $record_id),
'not_wrapped' => true
));
}
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="popover-inner" style="width:auto;">
<h3 class="popover-title">
{% if title %}
{% if title is not none %}
{{ title }}
{% endif %}
<button data-dismiss="modal" class="close tooltip_closer" style="display:none;">×</button>

View File

@@ -414,7 +414,7 @@
}
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 imgHeight = Math.round(height * factor);