소스 검색

[text-editor] dont keep refreshing value

version-14
Rushabh Mehta 8 년 전
부모
커밋
cfa84d7af3
1개의 변경된 파일10개의 추가작업 그리고 6개의 파일을 삭제
  1. +10
    -6
      frappe/public/js/frappe/form/control.js

+ 10
- 6
frappe/public/js/frappe/form/control.js 파일 보기

@@ -1884,12 +1884,16 @@ frappe.ui.form.ControlTextEditor = frappe.ui.form.ControlCode.extend({
},
set_in_editor: function(value) {
// 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() {
return this.editor.summernote('focus');


불러오는 중...
취소
저장