瀏覽代碼

[text-editor] dont keep refreshing value

version-14
Rushabh Mehta 8 年之前
父節點
當前提交
43ccc84584
共有 1 個檔案被更改,包括 9 行新增6 行删除
  1. +9
    -6
      frappe/public/js/frappe/form/control.js

+ 9
- 6
frappe/public/js/frappe/form/control.js 查看文件

@@ -1887,12 +1887,15 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
if(!this._last_change_on || (moment() - moment(this._last_change_on) > 3000)) { if(!this._last_change_on || (moment() - moment(this._last_change_on) > 3000)) {
this.editor.summernote('code', value); this.editor.summernote('code', value);
} else { } else {
var interval = setInterval(() => {
if(moment() - moment(this._last_change_on) > 3000) {
this.editor.summernote('code', value);
clearInterval(interval);
}
}, 1000);
if(!this._setting_value) {
this._setting_value = setInterval(() => {
if(moment() - moment(this._last_change_on) > 3000) {
this.editor.summernote('code', this.last_value);
clearInterval(this._setting_value);
this._setting_value = null;
}
}, 1000);
}
} }
}, },
set_focus: function() { set_focus: function() {


Loading…
取消
儲存