Browse Source

fix nav-link fadeIn (#2776)

pull/2780/head
REJack 5 years ago committed by GitHub
parent
commit
2eec6fe614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      build/js/PushMenu.js
  2. 7
      build/scss/_main-sidebar.scss

5
build/js/PushMenu.js

@ -38,6 +38,7 @@ const Selector = {
const ClassName = {
COLLAPSED: 'sidebar-collapse',
OPEN: 'sidebar-open',
IS_OPENING: 'sidebar-is-opening',
CLOSED: 'sidebar-closed'
}
@ -67,7 +68,7 @@ class PushMenu {
}
}
$(Selector.BODY).removeClass(ClassName.COLLAPSED).removeClass(ClassName.CLOSED)
$(Selector.BODY).addClass(ClassName.IS_OPENING).removeClass(`${ClassName.COLLAPSED} ${ClassName.CLOSED}`)
if (this._options.enableRemember) {
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.OPEN)
@ -83,7 +84,7 @@ class PushMenu {
}
}
$(Selector.BODY).addClass(ClassName.COLLAPSED)
$(Selector.BODY).removeClass(ClassName.IS_OPENING).addClass(ClassName.COLLAPSED)
if (this._options.enableRemember) {
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.COLLAPSED)

7
build/scss/_main-sidebar.scss

@ -185,10 +185,15 @@
.nav-link p {
display: inline-block;
margin: 0;
}
}
.sidebar-is-opening .nav-sidebar {
.nav-link p {
animation-name: fadeIn;
animation-duration: $transition-speed;
animation-fill-mode: both;
margin: 0;
}
}

Loading…
Cancel
Save