From 30dac452ad2197494768f0603e4ea92a9c33b47d Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Fri, 2 May 2014 18:07:55 -0300 Subject: [PATCH] note tooltip reimplemented --- mindplot/src/main/javascript/NoteIcon.js | 45 ++++++++++-------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/mindplot/src/main/javascript/NoteIcon.js b/mindplot/src/main/javascript/NoteIcon.js index 160f0934..b2a2944c 100644 --- a/mindplot/src/main/javascript/NoteIcon.js +++ b/mindplot/src/main/javascript/NoteIcon.js @@ -30,6 +30,7 @@ mindplot.NoteIcon = new Class({ }, _registerEvents:function () { + console.log('entro'); this._image.setCursor('pointer'); var me = this; @@ -41,39 +42,29 @@ mindplot.NoteIcon = new Class({ }); } 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:function () { - var result = $('
').css({padding:'5px'}); - - var title = $('
').text($msg('NOTE')) - .css({ - 'font-weight':'bold', - color:'black', - 'padding-bottom':'5px', - width:'100px' - }); - result.append(title); - - var text = $('
').text(me._linksModel.getText()) - .css({ - 'white-space':'pre-wrap', - 'word-wrap':'break-word' - } - ); - result.append(text); - return result; - }, + content: this._buildTooltipContent(), html:true, - position:'bottom', - arrowOffset:10, - center:true, - arrowSize:15, - offset:{x:10, y:20}, - className:'notesTip' + placement:'bottom' }); }, + _buildTooltipContent: function() { + var result = $('
').css({padding:'5px'}); + + var text = $('
').text(this._linksModel.getText()) + .css({ + 'white-space':'pre-wrap', + 'word-wrap':'break-word' + } + ); + result.append(text); + return result; + }, + getModel:function () { return this._linksModel; }