session: load: don't disable editor if it's already disabled

This commit is contained in:
jean-emmanuel 2018-03-15 12:58:00 +01:00
parent 943bc94ec3
commit a16e8c1ac4
2 changed files with 5 additions and 2 deletions

View file

@ -27,7 +27,7 @@ var Editor = class Editor {
this.clipboard = null
this.idClipboard = null
this.enabled = false
this.enabledOnce = false
window.onbeforeunload = ()=>{
if (this.enabledOnce) return true
@ -38,6 +38,7 @@ var Editor = class Editor {
enable() {
EDITING = true
this.enabled = true
this.enabledOnce = true
@ -81,6 +82,7 @@ var Editor = class Editor {
disable() {
EDITING = false
this.enabled = false
if (READ_ONLY) {
this.enable = ()=>{}

View file

@ -54,7 +54,8 @@ var SessionManager = class SessionManager {
}
state.set(state.get(), false)
editor.disable()
if (editor.enabled) editor.disable()
DOM.dispatchEvent(window, 'resize')
setTimeout(()=>{