note tooltip reimplemented

This commit is contained in:
Ezequiel Bergamaschi 2014-05-02 18:07:55 -03:00
parent 25b1199160
commit faf34707d1

View File

@ -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,39 +42,29 @@ 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(),
var result = $('<div></div>').css({padding:'5px'});
var title = $('<div></div>').text($msg('NOTE'))
.css({
'font-weight':'bold',
color:'black',
'padding-bottom':'5px',
width:'100px'
});
result.append(title);
var text = $('<div></div>').text(me._linksModel.getText())
.css({
'white-space':'pre-wrap',
'word-wrap':'break-word'
}
);
result.append(text);
return result;
},
html:true, html:true,
position:'bottom', placement:'bottom'
arrowOffset:10,
center:true,
arrowSize:15,
offset:{x:10, y:20},
className:'notesTip'
}); });
}, },
_buildTooltipContent: function() {
var result = $('<div></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;
},
getModel:function () { getModel:function () {
return this._linksModel; return this._linksModel;
} }