this.loadingFields = {};
this._maskChangeEvent = false;
this._maskChangeEventTimeout = null;
+ this._saveFormDataAfterTextChangeTimeout=null;
this.init();
}
}
}, 250);
- $(document).on('change keyup', "#linkeditor-panel-form input,#linkeditor-panel-form select,#linkeditor-panel-form textarea", function () {
+ $(document).on('change keyup', "#linkeditor-panel-form input,#linkeditor-panel-form select,#linkeditor-panel-form textarea", function (e) {
if ($this._maskChangeEvent) {
return;
}
- $this.saveFormDataInLink();
+
+ let callback = function () {
+ console.log('Save form data in link after change');
+ $this.saveFormDataInLink();
+ }
+
+ clearTimeout($this._saveFormDataAfterTextChangeTimeout);
+ if (e.type === 'change') {
+ callback();
+ } else {
+ $this._saveFormDataAfterTextChangeTimeout = setTimeout(callback, 500);
+ }
});