editor: prevent multiple delete popup
This commit is contained in:
parent
995dd7fe9b
commit
2df4661651
1 changed files with 9 additions and 0 deletions
|
|
@ -44,6 +44,8 @@ var Editor = class Editor {
|
|||
this.historyState = -1
|
||||
this.historySession = null
|
||||
|
||||
this.deleting = false
|
||||
|
||||
this.mousePosition = {x:0, y:0}
|
||||
this.mouveMoveHandler = this.mouseMove.bind(this)
|
||||
|
||||
|
|
@ -476,6 +478,10 @@ var Editor = class Editor {
|
|||
|
||||
deleteWidget() {
|
||||
|
||||
if (this.deleting) return
|
||||
|
||||
this.deleting = true
|
||||
|
||||
var index = this.selectedWidgets.map((w)=>DOM.index(w.container)).sort((a,b)=>{return b-a}),
|
||||
type = this.selectedWidgets[0].props.type == 'tab' ? 'tab' : 'widget',
|
||||
parent = this.selectedWidgets[0].parent
|
||||
|
|
@ -509,10 +515,13 @@ var Editor = class Editor {
|
|||
this.select(updateWidget(parent, {preventSelect: true}))
|
||||
this.pushHistory()
|
||||
|
||||
this.deleting = false
|
||||
|
||||
})
|
||||
|
||||
DOM.get(popup.html, '.cancel-delete')[0].addEventListener('click', function(){
|
||||
popup.close()
|
||||
this.deleting = false
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue