mirror of https://github.com/ColorlibHQ/AdminLTE
Merge pull request #509 from YasserHassan/patch-1
Trigger expand/collapse events for right sidebarpull/527/head
commit
3c031bccde
|
@ -316,15 +316,18 @@ function _init() {
|
||||||
|
|
||||||
//Enable sidebar push menu
|
//Enable sidebar push menu
|
||||||
if ($(window).width() > (screenSizes.sm - 1)) {
|
if ($(window).width() > (screenSizes.sm - 1)) {
|
||||||
$("body").toggleClass('sidebar-collapse');
|
if ($("body").hasClass('sidebar-collapse')) {
|
||||||
|
$("body").removeClass('sidebar-collapse').trigger('expanded.pushMenu');
|
||||||
|
} else {
|
||||||
|
$("body").addClass('sidebar-collapse').trigger('collapsed.pushMenu');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//Handle sidebar push menu for small screens
|
//Handle sidebar push menu for small screens
|
||||||
else {
|
else {
|
||||||
if ($("body").hasClass('sidebar-open')) {
|
if ($("body").hasClass('sidebar-open')) {
|
||||||
$("body").removeClass('sidebar-open');
|
$("body").removeClass('sidebar-open').removeClass('sidebar-collapse').trigger('collapsed.pushMenu');
|
||||||
$("body").removeClass('sidebar-collapse')
|
|
||||||
} else {
|
} else {
|
||||||
$("body").addClass('sidebar-open');
|
$("body").addClass('sidebar-open').trigger('expanded.pushMenu');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -342,7 +345,6 @@ function _init() {
|
||||||
&& $('body').hasClass('sidebar-mini'))) {
|
&& $('body').hasClass('sidebar-mini'))) {
|
||||||
this.expandOnHover();
|
this.expandOnHover();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
expandOnHover: function () {
|
expandOnHover: function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
Loading…
Reference in New Issue