Merge pull request #3039 from ColorlibHQ/feat/some-plugin-fixes

some plugin fixes
pull/3040/head
REJack 2020-09-21 10:45:22 +02:00 committed by GitHub
commit 99a1632731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 2 deletions

View File

@ -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)

View File

@ -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)
})
}

View File

@ -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;

View File

@ -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')`