[FIX] web: prevent handle from crashing with text field

289adeb63f introduced a bug where we tried to trigger an event on an element that didn't exist. Indeed there is no input if it's not in edit mode.

This commit fixes it.

PR: none
Task: none
This commit is contained in:
Sébastien Theys
2018-08-28 12:03:35 +02:00
parent e2bc4d57c2
commit 1c59de867d
2 changed files with 10 additions and 2 deletions
@@ -1079,7 +1079,9 @@ var FieldText = InputField.extend(TranslatableFieldMixin, {
reset: function () {
var self = this;
return $.when(this._super.apply(this, arguments)).then(function () {
self.$input.trigger('change');
if (self.mode === 'edit') {
self.$input.trigger('change');
}
});
},
//--------------------------------------------------------------------------