mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-26 07:44:56 +01:00
note tooltip reimplemented
This commit is contained in:
parent
a59c5e7372
commit
30dac452ad
@ -30,6 +30,7 @@ mindplot.NoteIcon = new Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_registerEvents:function () {
|
_registerEvents:function () {
|
||||||
|
console.log('entro');
|
||||||
this._image.setCursor('pointer');
|
this._image.setCursor('pointer');
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
@ -41,20 +42,20 @@ mindplot.NoteIcon = new Class({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
this._tip = new mindplot.widget.FloatingTip($(me.getImage()._peer._native), {
|
this._tip = new mindplot.widget.FloatingTip($(me.getImage()._peer._native), {
|
||||||
|
title: $msg('NOTE'),
|
||||||
|
container: 'body',
|
||||||
// Content can also be a function of the target element!
|
// Content can also be a function of the target element!
|
||||||
content:function () {
|
content: this._buildTooltipContent(),
|
||||||
|
html:true,
|
||||||
|
placement:'bottom'
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
_buildTooltipContent: function() {
|
||||||
var result = $('<div></div>').css({padding:'5px'});
|
var result = $('<div></div>').css({padding:'5px'});
|
||||||
|
|
||||||
var title = $('<div></div>').text($msg('NOTE'))
|
var text = $('<div></div>').text(this._linksModel.getText())
|
||||||
.css({
|
|
||||||
'font-weight':'bold',
|
|
||||||
color:'black',
|
|
||||||
'padding-bottom':'5px',
|
|
||||||
width:'100px'
|
|
||||||
});
|
|
||||||
result.append(title);
|
|
||||||
|
|
||||||
var text = $('<div></div>').text(me._linksModel.getText())
|
|
||||||
.css({
|
.css({
|
||||||
'white-space':'pre-wrap',
|
'white-space':'pre-wrap',
|
||||||
'word-wrap':'break-word'
|
'word-wrap':'break-word'
|
||||||
@ -63,16 +64,6 @@ mindplot.NoteIcon = new Class({
|
|||||||
result.append(text);
|
result.append(text);
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
html:true,
|
|
||||||
position:'bottom',
|
|
||||||
arrowOffset:10,
|
|
||||||
center:true,
|
|
||||||
arrowSize:15,
|
|
||||||
offset:{x:10, y:20},
|
|
||||||
className:'notesTip'
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
getModel:function () {
|
getModel:function () {
|
||||||
return this._linksModel;
|
return this._linksModel;
|
||||||
|
Loading…
Reference in New Issue
Block a user