diff --git a/mindplot/src/main/javascript/LinkIcon.js b/mindplot/src/main/javascript/LinkIcon.js index 58b6409d..56f93c49 100644 --- a/mindplot/src/main/javascript/LinkIcon.js +++ b/mindplot/src/main/javascript/LinkIcon.js @@ -43,8 +43,20 @@ mindplot.LinkIcon = new Class({ me._topic.showLinkEditor(); event.stopPropagation(); }); + //FIXME: we shouldn't have timeout of that.. + this.addEvent("mouseleave", function(event) { + window.setTimeout(function() { + if (!$("#linkPopover:hover").length) { + me._tip.hide(); + } + event.stopPropagation(); + }, 100) + }); } + $(this.getImage()._peer._native).mouseenter(function() { + me._tip.show(); + }) }, getModel:function () { diff --git a/mindplot/src/main/javascript/NoteIcon.js b/mindplot/src/main/javascript/NoteIcon.js index 8f6ce064..b6e32398 100644 --- a/mindplot/src/main/javascript/NoteIcon.js +++ b/mindplot/src/main/javascript/NoteIcon.js @@ -48,7 +48,8 @@ mindplot.NoteIcon = new Class({ return me._buildTooltipContent(); }, html:true, - placement:'bottom' + placement:'bottom', + destroyOnExit: true }); }, diff --git a/mindplot/src/main/javascript/widget/FloatingTip.js b/mindplot/src/main/javascript/widget/FloatingTip.js index 2280c9a5..ce9bb585 100644 --- a/mindplot/src/main/javascript/widget/FloatingTip.js +++ b/mindplot/src/main/javascript/widget/FloatingTip.js @@ -28,7 +28,8 @@ mindplot.widget.FloatingTip = new Class({ title: '', content: '', delay: 0, - container: false + container: false, + destroyOnExit: false }, initialize: function (element, options) { @@ -41,10 +42,12 @@ mindplot.widget.FloatingTip = new Class({ _createPopover: function() { this.element.popover(this.options); var me = this; - this.element.one('hidden.bs.popover', function() { - me.element.popover('destroy'); - me._createPopover(); - }); + if (this.options.destroyOnExit) { + this.element.one('hidden.bs.popover', function() { + me.element.popover('destroy'); + me._createPopover(); + }); + } }, show: function () { diff --git a/mindplot/src/main/javascript/widget/LinkIconTooltip.js b/mindplot/src/main/javascript/widget/LinkIconTooltip.js index 5cb1cf1c..eb9ade81 100644 --- a/mindplot/src/main/javascript/widget/LinkIconTooltip.js +++ b/mindplot/src/main/javascript/widget/LinkIconTooltip.js @@ -30,14 +30,8 @@ mindplot.widget.LinkIconTooltip = new Class({ container: 'body', title: $msg('LINK'), trigger: "manual", - template: '' + template: '' }); - var me = this; - nativeElement.mouseenter( - function() { - me.show(); - } - ); }, _buildContent:function (linkIcon) {