mirror of https://github.com/ColorlibHQ/AdminLTE
rework content height events
- add mouse enter/leave event - add timeout on expand/collapse sidebar eventpull/3159/head
parent
8196efdc5e
commit
b835bb678b
|
@ -27,6 +27,7 @@ const SELECTOR_PUSHMENU_BTN = '[data-widget="pushmenu"]'
|
||||||
const SELECTOR_LOGIN_BOX = '.login-box'
|
const SELECTOR_LOGIN_BOX = '.login-box'
|
||||||
const SELECTOR_REGISTER_BOX = '.register-box'
|
const SELECTOR_REGISTER_BOX = '.register-box'
|
||||||
|
|
||||||
|
const CLASS_NAME_SIDEBAR_COLLAPSED = 'sidebar-collapse'
|
||||||
const CLASS_NAME_SIDEBAR_FOCUSED = 'sidebar-focused'
|
const CLASS_NAME_SIDEBAR_FOCUSED = 'sidebar-focused'
|
||||||
const CLASS_NAME_LAYOUT_FIXED = 'layout-fixed'
|
const CLASS_NAME_LAYOUT_FIXED = 'layout-fixed'
|
||||||
const CLASS_NAME_CONTROL_SIDEBAR_SLIDE_OPEN = 'control-sidebar-slide-open'
|
const CLASS_NAME_CONTROL_SIDEBAR_SLIDE_OPEN = 'control-sidebar-slide-open'
|
||||||
|
@ -156,9 +157,18 @@ class Layout {
|
||||||
this.fixLayoutHeight()
|
this.fixLayoutHeight()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$(SELECTOR_MAIN_SIDEBAR)
|
||||||
|
.on('mouseenter mouseleave', () => {
|
||||||
|
if ($('body').hasClass(CLASS_NAME_SIDEBAR_COLLAPSED)) {
|
||||||
|
this.fixLayoutHeight()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
$(SELECTOR_PUSHMENU_BTN)
|
$(SELECTOR_PUSHMENU_BTN)
|
||||||
.on('collapsed.lte.pushmenu shown.lte.pushmenu', () => {
|
.on('collapsed.lte.pushmenu shown.lte.pushmenu', () => {
|
||||||
|
setTimeout(() => {
|
||||||
this.fixLayoutHeight()
|
this.fixLayoutHeight()
|
||||||
|
}, 300)
|
||||||
})
|
})
|
||||||
|
|
||||||
$(SELECTOR_CONTROL_SIDEBAR_BTN)
|
$(SELECTOR_CONTROL_SIDEBAR_BTN)
|
||||||
|
|
Loading…
Reference in New Issue