fixing all popover, some hacks

This commit is contained in:
Ezequiel Bergamaschi 2014-12-27 00:46:19 -03:00
parent 15c13a8f4f
commit bd3f1b39b2
4 changed files with 23 additions and 13 deletions

View File

@ -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 () {

View File

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

View File

@ -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 () {

View File

@ -30,14 +30,8 @@ mindplot.widget.LinkIconTooltip = new Class({
container: 'body',
title: $msg('LINK'),
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) {