mirror of https://github.com/ColorlibHQ/AdminLTE
added close right sidebar on document click if the slide option is enabled
parent
d4674d3a1d
commit
d6861e81be
|
@ -256,14 +256,14 @@ function _init() {
|
||||||
$(".content-wrapper, .right-side").css('min-height', sidebar_height);
|
$(".content-wrapper, .right-side").css('min-height', sidebar_height);
|
||||||
postSetWidth = sidebar_height;
|
postSetWidth = sidebar_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Fix for the control sidebar height
|
//Fix for the control sidebar height
|
||||||
var controlSidebar = $($.AdminLTE.options.controlSidebarOptions.selector);
|
var controlSidebar = $($.AdminLTE.options.controlSidebarOptions.selector);
|
||||||
if(typeof controlSidebar !== "undefined") {
|
if (typeof controlSidebar !== "undefined") {
|
||||||
if(controlSidebar.height() > postSetWidth)
|
if (controlSidebar.height() > postSetWidth)
|
||||||
$(".content-wrapper, .right-side").css('min-height', controlSidebar.height());
|
$(".content-wrapper, .right-side").css('min-height', controlSidebar.height());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fixSidebar: function () {
|
fixSidebar: function () {
|
||||||
|
@ -468,20 +468,26 @@ function _init() {
|
||||||
},
|
},
|
||||||
//Open the control sidebar
|
//Open the control sidebar
|
||||||
open: function (sidebar, slide) {
|
open: function (sidebar, slide) {
|
||||||
|
var _this = this;
|
||||||
//Slide over content
|
//Slide over content
|
||||||
if (slide)
|
if (slide) {
|
||||||
sidebar.addClass('control-sidebar-open');
|
sidebar.addClass('control-sidebar-open');
|
||||||
//Push the content by adding the open class to the body instead
|
$('.content-wrapper, .right-side').on('click', function () {
|
||||||
//of the sidebar itself
|
_this.close(sidebar, slide);
|
||||||
else
|
});
|
||||||
|
} else {
|
||||||
|
//Push the content by adding the open class to the body instead
|
||||||
|
//of the sidebar itself
|
||||||
$('body').addClass('control-sidebar-open');
|
$('body').addClass('control-sidebar-open');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//Close the control sidebar
|
//Close the control sidebar
|
||||||
close: function (sidebar, slide) {
|
close: function (sidebar, slide) {
|
||||||
if (slide)
|
if (slide) {
|
||||||
sidebar.removeClass('control-sidebar-open');
|
sidebar.removeClass('control-sidebar-open');
|
||||||
else
|
} else {
|
||||||
$('body').removeClass('control-sidebar-open');
|
$('body').removeClass('control-sidebar-open');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
_fix: function (sidebar) {
|
_fix: function (sidebar) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -206,7 +206,7 @@
|
||||||
demo_settings.append(skins_list);
|
demo_settings.append(skins_list);
|
||||||
|
|
||||||
tab_pane.append(demo_settings);
|
tab_pane.append(demo_settings);
|
||||||
$("#control-sidebar-settings-tab").before(tab_pane);
|
$("#control-sidebar-home-tab").after(tab_pane);
|
||||||
|
|
||||||
setup();
|
setup();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue