changeset 23d174996658 in sao:5.0 details: https://hg.tryton.org/sao?cmd=changeset&node=23d174996658 description: Use metaKey in addition to CtrlKey for click event
On MacOS CtrlKey is used to simulate a right-click. issue11420 review407311002 (grafted from 33bfd6702029e1d3f7556ac730d707aa8d2052ec) diffstat: src/view/form.js | 2 +- src/view/tree.js | 2 +- src/window.js | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diffs (63 lines): diff -r 92a0e08526d6 -r 23d174996658 src/view/form.js --- a/src/view/form.js Fri May 06 23:31:37 2022 +0200 +++ b/src/view/form.js Mon Apr 25 18:08:58 2022 +0200 @@ -2355,7 +2355,7 @@ if (this.has_target(value)) { var m2o_id = this.id_from_value(record.field_get(this.field_name)); - if (evt && evt.ctrlKey) { + if (evt && (evt.ctrlKey || evt.metaKey)) { var params = {}; params.model = this.get_model(); params.res_id = m2o_id; diff -r 92a0e08526d6 -r 23d174996658 src/view/tree.js --- a/src/view/tree.js Fri May 06 23:31:37 2022 +0200 +++ b/src/view/tree.js Mon Apr 25 18:08:58 2022 +0200 @@ -1132,7 +1132,7 @@ this.tree.select_changed(this.record); this.switch_row(); } else { - if (!event_.ctrlKey || + if (!(event_.ctrlKey || event_.metaKey) || this.tree.selection_mode == Sao.common.SELECTION_SINGLE) { this.tree.rows.forEach(function(row) { diff -r 92a0e08526d6 -r 23d174996658 src/window.js --- a/src/window.js Fri May 06 23:31:37 2022 +0200 +++ b/src/window.js Mon Apr 25 18:08:58 2022 +0200 @@ -1187,7 +1187,7 @@ var node = jQuery('<li/>', { 'field': field, }).text(el_field.attr('name')).click(function(e) { - if (e.ctrlKey) { + if (e.ctrlKey || e.metaKey) { node.toggleClass('bg-primary'); } else { jQuery(e.target).addClass('bg-primary') @@ -1211,7 +1211,7 @@ 'field': parent_node[field].field, 'name': parent_node[field].name }).text(name).click(function(e) { - if(e.ctrlKey) { + if (e.ctrlKey || e.metaKey) { node.toggleClass('bg-primary'); } else { this.fields_all.find('li').removeClass('bg-primary'); @@ -1506,7 +1506,7 @@ var node = jQuery('<li/>', { 'path': path }).text(parent_node[name].string).click(function(e) { - if(e.ctrlKey) { + if (e.ctrlKey || e.metaKey) { node.toggleClass('bg-primary'); } else { this.fields_all.find('li') @@ -1784,7 +1784,7 @@ var node = jQuery('<li/>', { 'path': name, }).text(long_string).click(function(e) { - if(e.ctrlKey) { + if (e.ctrlKey || e.metaKey) { node.toggleClass('bg-primary'); } else { jQuery(e.target).addClass('bg-primary')