diff options
author | sgiehl <stefan@piwik.org> | 2015-12-06 15:10:39 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2015-12-06 15:10:39 +0300 |
commit | 93cf5309335ac238d0ae4667c7b6da316623d889 (patch) | |
tree | 742307f72a8a21aa752ea1e126a92d96ae820ac7 | |
parent | 05852332f2a693b0cc313152fcb742fc063aa995 (diff) |
fixes #9266 - show tooltip for longer titles in popovers
-rw-r--r-- | plugins/CoreHome/javascripts/popover.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/CoreHome/javascripts/popover.js b/plugins/CoreHome/javascripts/popover.js index 3766bdad66..308fc7a4bb 100644 --- a/plugins/CoreHome/javascripts/popover.js +++ b/plugins/CoreHome/javascripts/popover.js @@ -142,7 +142,17 @@ var Piwik_Popover = (function () { /** Set the title of the popover */ setTitle: function (titleHtml) { + var titleText = $('<div>' + titleHtml + '</div>').text(); + if (titleText.length > 60) { + titleHtml = $('<span>').attr('class', 'tooltip').attr('title', titleText).html(titleHtml); + } container.dialog('option', 'title', titleHtml); + try { + $('.tooltip', container.parentNode).tooltip('destroy'); + } catch (e) {} + if (titleText.length > 60) { + $('.tooltip', container.parentNode).tooltip({track: true, items: '.tooltip'}); + } }, /** Set inner HTML of the popover */ |