mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-12-23 20:03:48 +01:00
fix popover not updated when updating notes
This commit is contained in:
parent
91f85139ca
commit
15c13a8f4f
@ -44,7 +44,9 @@ mindplot.NoteIcon = new Class({
|
||||
title: $msg('NOTE'),
|
||||
container: 'body',
|
||||
// Content can also be a function of the target element!
|
||||
content: this._buildTooltipContent(),
|
||||
content: function() {
|
||||
return me._buildTooltipContent();
|
||||
},
|
||||
html:true,
|
||||
placement:'bottom'
|
||||
});
|
||||
@ -52,16 +54,21 @@ mindplot.NoteIcon = new Class({
|
||||
},
|
||||
|
||||
_buildTooltipContent: function() {
|
||||
var result = $('<div></div>').css({padding:'5px'});
|
||||
if ($("body").find("#textPopoverNote").length == 1) {
|
||||
var text = $("body").find("#textPopoverNote");
|
||||
text.text(this._linksModel.getText());
|
||||
} else {
|
||||
var result = $('<div id="textPopoverNote"></div>').css({padding:'5px'});
|
||||
|
||||
var text = $('<div></div>').text(this._linksModel.getText())
|
||||
.css({
|
||||
'white-space':'pre-wrap',
|
||||
'word-wrap':'break-word'
|
||||
}
|
||||
);
|
||||
result.append(text);
|
||||
return result;
|
||||
var text = $('<div></div>').text(this._linksModel.getText())
|
||||
.css({
|
||||
'white-space':'pre-wrap',
|
||||
'word-wrap':'break-word'
|
||||
}
|
||||
);
|
||||
result.append(text);
|
||||
return result;
|
||||
}
|
||||
},
|
||||
|
||||
getModel:function () {
|
||||
|
@ -34,7 +34,17 @@ mindplot.widget.FloatingTip = new Class({
|
||||
initialize: function (element, options) {
|
||||
this.setOptions(options);
|
||||
this.element = element;
|
||||
element.popover(this.options);
|
||||
this._createPopover();
|
||||
},
|
||||
|
||||
//FIXME: find a better way to do that...
|
||||
_createPopover: function() {
|
||||
this.element.popover(this.options);
|
||||
var me = this;
|
||||
this.element.one('hidden.bs.popover', function() {
|
||||
me.element.popover('destroy');
|
||||
me._createPopover();
|
||||
});
|
||||
},
|
||||
|
||||
show: function () {
|
||||
|
Loading…
Reference in New Issue
Block a user