adsabs/adsabs — pull request #68 by ehenneken (2013-12-19 13:58:10+00:00)
Title: Ticket 402: Help tooltips for metrics

Help tooltips for the metrics overview are now working. The help text, together with the tooltip machinery (based on the bootstrap 'popover' widget) are in 'tooltips.js' in the local static directory for 'bibutils'. The solution right now is not ideal. Essentially it works as follows: the metrics overview has entries like

?

calling 'show_help' in 'helptips.js', which then does

HelpTipManager.show_help = function(item)
{
// Get the help text
var text_type = this.help_text[item.id];
// Create the Help tip using popover from bootstrap
$(item).popover({
html: true,
trigger: "hover focus",
title: text_type['title'],
content: text_type['help'],
});
};

getting the relevant text from

HelpTipManager.help_text['NUMBER_OF_PAPERS'] = {'title':'Number of papers', 'help':'The total number of papers'};

However, if you do this, the help tooltip only appears at the second hover. Adding the other '$(document).ready(function(){' function make the tooltips appear immediately.