Skip to content
Snippets Groups Projects
Commit 26f91c42 authored by qsm-odoo's avatar qsm-odoo Committed by Aaron Bohy
Browse files

[FIX] web: cannot debounce prototype function of Widget

The `_onClickStage` method of the `FieldStatus` was debounced. This can
be done but not directly on prototype functions because they are shared
between each instances (just called with different `this`). This does
not produced any bug because there never are two instances of this
class which are used at the same time in the web client. The problem is
however present when trying to make tests as clicks on different
statusbar buttons in two different tests were filtered by the
debouncing.
parent aa371a3e
Branches
Tags
No related merge requests found
......@@ -1178,6 +1178,7 @@ var FieldStatus = AbstractField.extend({
init: function () {
this._super.apply(this, arguments);
this._setState();
this._onClickStage = _.debounce(this._onClickStage, 300, true); // TODO maybe not useful anymore ?
},
//--------------------------------------------------------------------------
......@@ -1246,14 +1247,13 @@ var FieldStatus = AbstractField.extend({
/**
* Called when on status stage is clicked -> sets the field value.
* Note: this function is debounced...
*
* @private
* @param {MouseEvent} e
*/
_onClickStage: _.debounce(function (e) {
_onClickStage: function (e) {
this._setValue($(e.currentTarget).data("value"));
}, 300, true),
},
});
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment