From a59c5e737223d7925c8a16ff710ede49c342d8ea Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Fri, 2 May 2014 17:55:35 -0300 Subject: [PATCH] LinkIconTooltip reimplemented --- .../main/javascript/widget/LinkIconTooltip.js | 65 +++++++------------ 1 file changed, 23 insertions(+), 42 deletions(-) diff --git a/mindplot/src/main/javascript/widget/LinkIconTooltip.js b/mindplot/src/main/javascript/widget/LinkIconTooltip.js index 8208cb06..3cadface 100644 --- a/mindplot/src/main/javascript/widget/LinkIconTooltip.js +++ b/mindplot/src/main/javascript/widget/LinkIconTooltip.js @@ -23,70 +23,51 @@ mindplot.widget.LinkIconTooltip = new Class({ $assert(linkIcon, "linkIcon can not be null"); this.parent($(linkIcon.getImage()._peer._native), { // Content can also be a function of the target element! - content:this._buildContent.pass(linkIcon, this), + content:this._buildContent(linkIcon), html:true, - position:'bottom', - arrowOffset:10, - center:true, - arrowSize:15, - offset:{x:10, y:20}, - className:'linkTip' + placement:'bottom', + container: 'body', + title: $msg('LINK') }); }, _buildContent:function (linkIcon) { - var result = new Element('div'); - result.setStyles({ + var result = $('
').css({ padding:'5px', width:'100%' }); - var title = new Element('div', {text:$msg('LINK')}); - title.setStyles({ - 'font-weight':'bold', - color:'black', - 'padding-bottom':'5px', - width:'100px' + var text = $('
').text("URL: " + linkIcon.getModel().getUrl()) + .css({ + 'white-space':'pre-wrap', + 'word-wrap':'break-word' }); - title.inject(result); + result.append(text); - var text = new Element('div', {text:"URL: " + linkIcon.getModel().getUrl()}); - text.setStyles({ - 'white-space':'pre-wrap', - 'word-wrap':'break-word' - } - ); - text.inject(result); - - var imgContainer = new Element('div'); - imgContainer.setStyles({ + var imgContainer = $('
') + .css({ width:'100%', - textAlign:'right', + 'textAlign':'right', 'padding-bottom':'5px', 'padding-top':'5px' }); - var img = new Element('img', { - src:'http://immediatenet.com/t/m?Size=1024x768&URL=' + linkIcon.getModel().getUrl(), - img:linkIcon.getModel().getUrl(), - alt:linkIcon.getModel().getUrl() - } - ); - img.setStyles({ - padding:'5px' - } - ); + var img = $('') + .prop('src', 'http://immediatenet.com/t/m?Size=1024x768&URL=' + linkIcon.getModel().getUrl()) + .prop('img', linkIcon.getModel().getUrl()) + .prop('alt', linkIcon.getModel().getUrl()); - var link = new Element('a', { + img.css('padding', '5px'); + + var link = $('').attr({ href:linkIcon.getModel().getUrl(), alt:'Open in new window ...', target:'_blank' - }); - img.inject(link); - link.inject(imgContainer); - imgContainer.inject(result); + link.append(img); + imgContainer.append(link); + result.append(imgContainer); return result; } }); \ No newline at end of file