Do not bind twice keydown event on key_press method

The event is already binded in the Form widget so the EditableTree widget does
not need to bind it again otherwise the callback is called twice per event.

issue8429
review255571002
This commit is contained in:
Cédric Krier
2019-06-20 23:15:06 +02:00
parent b7b8f3c278
commit 9d820ef4cc
-3
View File
@@ -2154,7 +2154,6 @@
init: function(view, attributes) {
Sao.View.EditableTree.Many2One._super.init.call(
this, view, attributes);
this.el.on('keydown', this.key_press.bind(this));
},
key_press: function(event_) {
if (event_.which == Sao.common.TAB_KEYCODE) {
@@ -2171,7 +2170,6 @@
init: function(view, attributes) {
Sao.View.EditableTree.Reference._super.init.call(
this, view, attributes);
this.el.on('keydown', this.key_press.bind(this));
},
key_press: function(event_) {
if (event_.which == Sao.common.TAB_KEYCODE) {
@@ -2188,7 +2186,6 @@
init: function(view, attributes) {
Sao.View.EditableTree.One2One._super.init.call(
this, view, attributes);
this.el.on('keydown', this.key_press.bind(this));
},
key_press: function(event_) {
if (event_.which == Sao.common.TAB_KEYCODE) {