sidepanel: prevent double click glitch
This commit is contained in:
parent
612c8ba45a
commit
be485f1085
1 changed files with 7 additions and 0 deletions
|
|
@ -159,8 +159,12 @@ if (fullscreen.enabled) {
|
|||
|
||||
// open / close / toggle
|
||||
|
||||
var sidepaneLock = false
|
||||
|
||||
function sidepanelOpen() {
|
||||
|
||||
sidepaneLock = true
|
||||
|
||||
DOM.get('#open-toggle, #sidepanel').forEach((el)=>{
|
||||
el.classList.add('sidepanel-open')
|
||||
})
|
||||
|
|
@ -169,6 +173,7 @@ function sidepanelOpen() {
|
|||
DOM.get('#container')[0].classList.add('sidepanel-open')
|
||||
setTimeout(function(){
|
||||
DOM.dispatchEvent(window, 'resize')
|
||||
sidepaneLock = false
|
||||
}, 25)
|
||||
}, 250)
|
||||
|
||||
|
|
@ -176,6 +181,8 @@ function sidepanelOpen() {
|
|||
|
||||
function sidepanelClose() {
|
||||
|
||||
if (sidepaneLock) return
|
||||
|
||||
DOM.get('#open-toggle, #sidepanel, #container').forEach((el)=>{
|
||||
el.classList.remove('sidepanel-open')
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue