Support for inline explanatory popups in problem XML

This commit is contained in:
Braden MacDonald
2015-01-14 19:39:19 -08:00
parent 4c809fb6ae
commit 3fd9fa6415
8 changed files with 178 additions and 41 deletions

View File

@@ -26,7 +26,7 @@
'mouseover.TooltipManager': this.showTooltip,
'mousemove.TooltipManager': this.moveTooltip,
'mouseout.TooltipManager': this.hideTooltip,
'click.TooltipManager': this.hideTooltip
'click.TooltipManager': this.click
}, this.SELECTOR);
},
@@ -68,6 +68,18 @@
this.tooltipTimer = setTimeout(this.hide, 50);
},
click: function(event) {
var showOnClick = !!$(event.currentTarget).data('tooltip-show-on-click'); // Default is false
if (showOnClick) {
this.show();
if (this.tooltipTimer) {
clearTimeout(this.tooltipTimer);
}
} else {
this.hideTooltip(event);
}
},
destroy: function () {
this.tooltip.remove();
// Unbind all delegated event handlers in the ".TooltipManager"