enhanced javascript plugins

- added expand & collapse method in PushMenu
- added expandSidebar & sidebarButtonSelector option in Treeview
- updated docs
This commit is contained in:
REJack
2019-11-13 14:10:18 +01:00
parent 7e86bd68cb
commit f5286d6229
9 changed files with 50 additions and 20 deletions

View File

@@ -61,7 +61,7 @@ const PushMenu = (($) => {
// Public
show() {
expand() {
if (this._options.autoCollapseSize) {
if ($(window).width() <= this._options.autoCollapseSize) {
$(Selector.BODY).addClass(ClassName.OPEN)
@@ -96,10 +96,10 @@ const PushMenu = (($) => {
}
toggle() {
if (!$(Selector.BODY).hasClass(ClassName.COLLAPSED )) {
if (!$(Selector.BODY).hasClass(ClassName.COLLAPSED)) {
this.collapse()
} else {
this.show()
this.expand()
}
}
@@ -177,7 +177,7 @@ const PushMenu = (($) => {
$(this).data(DATA_KEY, data)
}
if (operation === 'toggle') {
if (typeof operation === 'string' && operation.match(/collapse|expand|toggle/)) {
data[operation]()
}
})