session: load: don't disable editor if it's already disabled
This commit is contained in:
parent
943bc94ec3
commit
a16e8c1ac4
2 changed files with 5 additions and 2 deletions
|
|
@ -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 = ()=>{}
|
||||
|
|
|
|||
|
|
@ -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(()=>{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue