Pārlūkot izejas kodu

[text-editor] dont keep refreshing value

version-14
Rushabh Mehta pirms 8 gadiem
vecāks
revīzija
cfa84d7af3
1 mainītis faili ar 10 papildinājumiem un 6 dzēšanām
  1. +10
    -6
      frappe/public/js/frappe/form/control.js

+ 10
- 6
frappe/public/js/frappe/form/control.js Parādīt failu

@@ -1884,12 +1884,16 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
}, },
set_in_editor: function(value) { set_in_editor: function(value) {
// set value after user has stopped editing // set value after user has stopped editing
let interval = setInterval(() => {
if(moment() - moment(this._last_change_on) > 3000) {
this.editor.summernote('code', value);
clearInterval(interval);
}
}, 1000);
if(!this._last_change_on || (moment() - moment(this._last_change_on) > 3000)) {
this.editor.summernote('code', value);
} else {
var interval = setInterval(() => {
if(moment() - moment(this._last_change_on) > 3000) {
this.editor.summernote('code', value);
clearInterval(interval);
}
}, 1000);
}
}, },
set_focus: function() { set_focus: function() {
return this.editor.summernote('focus'); return this.editor.summernote('focus');


Notiek ielāde…
Atcelt
Saglabāt