From a21327ff7e9f096cce11507686af55ce9153e9ad Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 17 Dec 2014 12:37:03 +0000 Subject: [PATCH] fix #2597 (pandora): 'if an annotation contains a link, tooltip has to change' --- source/UI/js/Form/ArrayEditable.js | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/source/UI/js/Form/ArrayEditable.js b/source/UI/js/Form/ArrayEditable.js index 4efb2d50..4907dbd9 100644 --- a/source/UI/js/Form/ArrayEditable.js +++ b/source/UI/js/Form/ArrayEditable.js @@ -174,17 +174,23 @@ Ox.ArrayEditable = function(options, self) { highlight: self.options.highlight, maxHeight: self.options.maxHeight, submitOnBlur: self.options.submitOnBlur, - tooltip: ( - self.options.tooltipText - ? self.options.tooltipText(item) + '
' - : '' - ) + ( - self.options.editable - ? Ox._('Click to select') + ( - item.editable ? Ox._(', doubleclick to edit') : '' - ) - : '' - ), + tooltip: function(e) { + var $target = $(e.target), + isLink = $target.is('a') || $target.parents('a').length, + click = isLink ? 'Shift-click' : 'Click', + doubleclick = isLink ? 'shift-doubleclick' : 'doubleclick'; + return ( + self.options.tooltipText + ? self.options.tooltipText(item) + '
' + : '' + ) + ( + self.options.editable + ? Ox._(click + ' to select') + ( + item.editable ? Ox._(', ' + doubleclick + ' to edit') : '' + ) + : '' + ); + }, type: self.options.type, unformat: self.options.unformat, value: item.value,