fixing all popover, some hacks

This commit is contained in:
Ezequiel Bergamaschi 2014-12-27 00:46:19 -03:00
parent 4732b13196
commit 596d567ee4
4 changed files with 23 additions and 13 deletions

View File

@ -43,8 +43,20 @@ mindplot.LinkIcon = new Class({
me._topic.showLinkEditor(); me._topic.showLinkEditor();
event.stopPropagation(); 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 () { getModel:function () {

View File

@ -48,7 +48,8 @@ mindplot.NoteIcon = new Class({
return me._buildTooltipContent(); return me._buildTooltipContent();
}, },
html:true, html:true,
placement:'bottom' placement:'bottom',
destroyOnExit: true
}); });
}, },

View File

@ -28,7 +28,8 @@ mindplot.widget.FloatingTip = new Class({
title: '', title: '',
content: '', content: '',
delay: 0, delay: 0,
container: false container: false,
destroyOnExit: false
}, },
initialize: function (element, options) { initialize: function (element, options) {
@ -41,10 +42,12 @@ mindplot.widget.FloatingTip = new Class({
_createPopover: function() { _createPopover: function() {
this.element.popover(this.options); this.element.popover(this.options);
var me = this; var me = this;
this.element.one('hidden.bs.popover', function() { if (this.options.destroyOnExit) {
me.element.popover('destroy'); this.element.one('hidden.bs.popover', function() {
me._createPopover(); me.element.popover('destroy');
}); me._createPopover();
});
}
}, },
show: function () { show: function () {

View File

@ -30,14 +30,8 @@ mindplot.widget.LinkIconTooltip = new Class({
container: 'body', container: 'body',
title: $msg('LINK'), title: $msg('LINK'),
trigger: "manual", trigger: "manual",
template: '<div class="popover" onmouseover="$(this).mouseleave(function() {$(this).hide(); });" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' template: '<div id="linkPopover" class="popover" onmouseover="$(this).mouseleave(function() {$(this).fadeOut(200); });" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
}); });
var me = this;
nativeElement.mouseenter(
function() {
me.show();
}
);
}, },
_buildContent:function (linkIcon) { _buildContent:function (linkIcon) {