fix #2597 (pandora): 'if an annotation contains a link, tooltip has to change'

This commit is contained in:
rolux 2014-12-17 12:37:03 +00:00
parent e43881c594
commit a21327ff7e

View file

@ -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) + '<br>'
: ''
) + (
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) + '<br>'
: ''
) + (
self.options.editable
? Ox._(click + ' to select') + (
item.editable ? Ox._(', ' + doubleclick + ' to edit') : ''
)
: ''
);
},
type: self.options.type,
unformat: self.options.unformat,
value: item.value,