diff --git a/build/js/Dropdown.js b/build/js/Dropdown.js index 0bf29f2a0..072163b9d 100644 --- a/build/js/Dropdown.js +++ b/build/js/Dropdown.js @@ -22,6 +22,7 @@ const SELECTOR_DROPDOWN_MENU_ACTIVE = '.dropdown-menu.show' const SELECTOR_DROPDOWN_TOGGLE = '[data-toggle="dropdown"]' const CLASS_NAME_DROPDOWN_RIGHT = 'dropdown-menu-right' +const CLASS_NAME_DROPDOWN_SUBMENU = 'dropdown-submenu' // TODO: this is unused; should be removed along with the extend? const Default = { @@ -122,6 +123,10 @@ $(`${SELECTOR_DROPDOWN_MENU} ${SELECTOR_DROPDOWN_TOGGLE}`).on('click', function $(`${SELECTOR_NAVBAR} ${SELECTOR_DROPDOWN_TOGGLE}`).on('click', event => { event.preventDefault() + if ($(event.target).parent().hasClass(CLASS_NAME_DROPDOWN_SUBMENU)) { + return + } + setTimeout(function () { Dropdown._jQueryInterface.call($(this), 'fixPosition') }, 1) diff --git a/build/js/Treeview.js b/build/js/Treeview.js index decf2452b..928792abf 100644 --- a/build/js/Treeview.js +++ b/build/js/Treeview.js @@ -118,7 +118,8 @@ class Treeview { // Private _setupListeners() { - $(document).on('click', this._config.trigger, event => { + const elementId = this._element.attr('id') !== undefined ? `#${this._element.attr('id')}` : '' + $(document).on('click', `${elementId}${this._config.trigger}`, event => { this.toggle(event) }) } diff --git a/build/scss/_cards.scss b/build/scss/_cards.scss index 3f609662e..dee3d6de7 100644 --- a/build/scss/_cards.scss +++ b/build/scss/_cards.scss @@ -34,7 +34,7 @@ position: fixed; top: 0; width: 100% !important; - z-index: 9999; + z-index: $zindex-modal-backdrop; &.was-collapsed .card-body { display: block !important; diff --git a/docs/javascript/control-sidebar.md b/docs/javascript/control-sidebar.md index 718c66a7c..9ec14c656 100644 --- a/docs/javascript/control-sidebar.md +++ b/docs/javascript/control-sidebar.md @@ -61,3 +61,17 @@ $("#my-toggle-button").ControlSidebar('toggle'); {: .table .table-bordered .bg-light} Example: `$('#toggle-button').on('expanded.lte.controlsidebar', handleExpandedEvent)` + + +##### Methods +{: .mt-4} + +|--- +| Method | Description +|-|- +|collapse | Collapses the control-sidebar +|show | Show's the control-sidebar +|toggle | Toggles the state of the control-sidebar expanded and collapsed +{: .table .table-bordered .bg-light} + +Example: `$('#toggle-button').ControlSidebar('toggle')`