Fix partial HTML broke label in context menu Copy "..." action

This commit is contained in:
nathangray 2019-07-31 11:21:36 -06:00
parent c580dcb64f
commit ed01dfad0a

View File

@ -65,7 +65,7 @@ function egwPopupAction(_id, _handler, _caption, _icon, _onExecute, _allowOnMult
/** /**
* Set either a confirmation prompt, or TRUE to indicate that this action * Set either a confirmation prompt, or TRUE to indicate that this action
* cares about large selections and to ask the confirmation prompt(s) * cares about large selections and to ask the confirmation prompt(s)
* *
* @param {String|Boolean} _value * @param {String|Boolean} _value
*/ */
action.set_confirm_mass_selection = function(_value) { action.set_confirm_mass_selection = function(_value) {
@ -743,7 +743,7 @@ function egwPopupActionImplementation()
},true); },true);
clipboard_action.group = 2.5; clipboard_action.group = 2.5;
} }
var os_clipboard_caption = this._context.event.originalEvent.target.innerHTML.trim(); var os_clipboard_caption = this._context.event.originalEvent.target.innerText.trim();
clipboard_action.set_caption(egw.lang('Copy "%1"', os_clipboard_caption.length>20 ? os_clipboard_caption.substring(0,20)+'...':os_clipboard_caption)); clipboard_action.set_caption(egw.lang('Copy "%1"', os_clipboard_caption.length>20 ? os_clipboard_caption.substring(0,20)+'...':os_clipboard_caption));
clipboard_action.data.target = this._context.event.originalEvent.target; clipboard_action.data.target = this._context.event.originalEvent.target;
jQuery(clipboard_action.data.target).off('copy').on('copy', function(event) { jQuery(clipboard_action.data.target).off('copy').on('copy', function(event) {