mirror of
https://github.com/nextcloud/server.git
synced 2026-05-19 08:25:56 -04:00
Fix:non responsive app navigation toggle
Signed-off-by: hamza221 <hamzamahjoubi221@gmail.com>
This commit is contained in:
parent
25dad2ec0d
commit
6cffaceb76
3 changed files with 5 additions and 32 deletions
|
|
@ -140,44 +140,17 @@ export const initCore = () => {
|
|||
|
||||
$('#app-content').prepend('<div id="app-navigation-toggle" class="icon-menu" style="display:none" tabindex="0"></div>')
|
||||
|
||||
// keep track whether snapper is currently animating, and
|
||||
// prevent to call open or close while that is the case
|
||||
// to avoid duplicating events (snap.js doesn't check this)
|
||||
let animating = false
|
||||
snapper.on('animating', () => {
|
||||
// we need this because the trigger button
|
||||
// is also implicitly wired to close by snapper
|
||||
animating = true
|
||||
})
|
||||
snapper.on('animated', () => {
|
||||
animating = false
|
||||
})
|
||||
snapper.on('start', () => {
|
||||
// we need this because dragging triggers that
|
||||
animating = true
|
||||
})
|
||||
snapper.on('end', () => {
|
||||
// we need this because dragging stop triggers that
|
||||
animating = false
|
||||
})
|
||||
|
||||
// These are necessary because calling open or close
|
||||
// on snapper during an animation makes it trigger an
|
||||
// unfinishable animation, which itself will continue
|
||||
// triggering animating events and cause high CPU load,
|
||||
//
|
||||
// Ref https://github.com/jakiestfu/Snap.js/issues/216
|
||||
const oldSnapperOpen = snapper.open
|
||||
const oldSnapperClose = snapper.close
|
||||
const _snapperOpen = () => {
|
||||
if (animating || snapper.state().state !== 'closed') {
|
||||
if (snapper.state().state !== 'closed') {
|
||||
return
|
||||
}
|
||||
oldSnapperOpen('left')
|
||||
}
|
||||
|
||||
const _snapperClose = () => {
|
||||
if (animating || snapper.state().state === 'closed') {
|
||||
if (snapper.state().state === 'closed') {
|
||||
return
|
||||
}
|
||||
oldSnapperClose()
|
||||
|
|
|
|||
4
dist/core-main.js
vendored
4
dist/core-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-main.js.map
vendored
2
dist/core-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue