mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-12-24 12:13:49 +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'),
|
title: $msg('NOTE'),
|
||||||
container: 'body',
|
container: 'body',
|
||||||
// Content can also be a function of the target element!
|
// Content can also be a function of the target element!
|
||||||
content: this._buildTooltipContent(),
|
content: function() {
|
||||||
|
return me._buildTooltipContent();
|
||||||
|
},
|
||||||
html:true,
|
html:true,
|
||||||
placement:'bottom'
|
placement:'bottom'
|
||||||
});
|
});
|
||||||
@ -52,16 +54,21 @@ mindplot.NoteIcon = new Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_buildTooltipContent: function() {
|
_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())
|
var text = $('<div></div>').text(this._linksModel.getText())
|
||||||
.css({
|
.css({
|
||||||
'white-space':'pre-wrap',
|
'white-space':'pre-wrap',
|
||||||
'word-wrap':'break-word'
|
'word-wrap':'break-word'
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
result.append(text);
|
result.append(text);
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getModel:function () {
|
getModel:function () {
|
||||||
|
@ -34,7 +34,17 @@ mindplot.widget.FloatingTip = new Class({
|
|||||||
initialize: function (element, options) {
|
initialize: function (element, options) {
|
||||||
this.setOptions(options);
|
this.setOptions(options);
|
||||||
this.element = element;
|
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 () {
|
show: function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user