Use metaKey in addition to CtrlKey for click event
On MacOS CtrlKey is used to simulate a right-click. issue11420 review407311002
This commit is contained in:
+1
-1
@@ -2626,7 +2626,7 @@ function eval_pyson(value){
|
||||
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;
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
}
|
||||
this.select_records(i, view_form_idx);
|
||||
} else {
|
||||
if (!event_.ctrlKey) {
|
||||
if (!(event_.ctrlKey || event_.metaKey)) {
|
||||
this.select_records(null, null);
|
||||
}
|
||||
this.record = view_form.record;
|
||||
|
||||
+3
-3
@@ -569,7 +569,7 @@
|
||||
|
||||
var parent_row = null;
|
||||
var dest_position;
|
||||
if (evt.ctrlKey && this.children_field) {
|
||||
if ((evt.ctrlKey || evt.metaKey) && this.children_field) {
|
||||
parent_row = this._find_row(row.el.prev());
|
||||
dest_position = (parent_row || this).rows.length;
|
||||
} else {
|
||||
@@ -1793,7 +1793,7 @@
|
||||
current_record = this.tree.screen.current_record;
|
||||
this.tree.select_records(current_record, this.record);
|
||||
} else {
|
||||
if (!event_.ctrlKey ||
|
||||
if (!(event_.ctrlKey || event_.metaKey) ||
|
||||
this.tree.selection_mode ==
|
||||
Sao.common.SELECTION_SINGLE) {
|
||||
this.tree.select_records(null, null);
|
||||
@@ -1987,7 +1987,7 @@
|
||||
|
||||
Sao.View.Tree.RowEditable._super.select_row.call(this, event_);
|
||||
|
||||
if (!event_.shiftKey && !event_.ctrlKey) {
|
||||
if (!event_.shiftKey && !(event_.ctrlKey || event_.metaKey)) {
|
||||
this.tree.edit_row(this);
|
||||
}
|
||||
},
|
||||
|
||||
+4
-4
@@ -1314,7 +1314,7 @@
|
||||
}).text(el_field.attr('name')).prepend(
|
||||
Sao.common.ICONFACTORY.get_icon_img('tryton-drag')
|
||||
).click(function(e) {
|
||||
if (e.ctrlKey) {
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
node.toggleClass('bg-primary');
|
||||
} else {
|
||||
jQuery(e.target).addClass('bg-primary')
|
||||
@@ -1338,7 +1338,7 @@
|
||||
'field': parent_node[field].field,
|
||||
'name': parent_node[field].name
|
||||
}).text(name).click(e => {
|
||||
if(e.ctrlKey) {
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
node.toggleClass('bg-primary');
|
||||
} else {
|
||||
this.fields_all.find('li').removeClass('bg-primary');
|
||||
@@ -1699,7 +1699,7 @@
|
||||
var node = jQuery('<li/>', {
|
||||
'path': path
|
||||
}).text(parent_node[name].string).click(e => {
|
||||
if(e.ctrlKey) {
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
node.toggleClass('bg-primary');
|
||||
} else {
|
||||
this.fields_all.find('li')
|
||||
@@ -1948,7 +1948,7 @@
|
||||
'path': name,
|
||||
'class': 'draggable-handle',
|
||||
}).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')
|
||||
|
||||
Reference in New Issue
Block a user