mirror of https://github.com/ColorlibHQ/AdminLTE
fixed control-sidebar slide option
- renamed `slide` to `controlsidebarSlide` to avoid bootstrap js error - reworked js to get slide false working without transition - added .control-sidebar-hold-transitionpull/2268/head
parent
d3a213afda
commit
7b6e000dc6
|
@ -12,7 +12,7 @@
|
||||||
var DataKey = 'lte.controlsidebar';
|
var DataKey = 'lte.controlsidebar';
|
||||||
|
|
||||||
var Default = {
|
var Default = {
|
||||||
slide: true
|
controlsidebarSlide: true
|
||||||
};
|
};
|
||||||
|
|
||||||
var Selector = {
|
var Selector = {
|
||||||
|
@ -26,7 +26,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
var ClassName = {
|
var ClassName = {
|
||||||
open : 'control-sidebar-open',
|
open: 'control-sidebar-open',
|
||||||
|
transition: 'control-sidebar-hold-transition',
|
||||||
fixed: 'fixed'
|
fixed: 'fixed'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -72,8 +73,11 @@
|
||||||
|
|
||||||
ControlSidebar.prototype.expand = function () {
|
ControlSidebar.prototype.expand = function () {
|
||||||
$(Selector.sidebar).show();
|
$(Selector.sidebar).show();
|
||||||
if (!this.options.slide) {
|
if (!this.options.controlsidebarSlide) {
|
||||||
$('body').addClass(ClassName.open);
|
$('body').addClass(ClassName.transition).addClass(ClassName.open).delay(50).queue(function(){
|
||||||
|
$('body').removeClass(ClassName.transition);
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
$(Selector.sidebar).addClass(ClassName.open);
|
$(Selector.sidebar).addClass(ClassName.open);
|
||||||
}
|
}
|
||||||
|
@ -83,7 +87,14 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
ControlSidebar.prototype.collapse = function () {
|
ControlSidebar.prototype.collapse = function () {
|
||||||
$('body, ' + Selector.sidebar).removeClass(ClassName.open);
|
if (!this.options.controlsidebarSlide) {
|
||||||
|
$('body').addClass(ClassName.transition).removeClass(ClassName.open).delay(50).queue(function(){
|
||||||
|
$('body').removeClass(ClassName.transition);
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
$(Selector.sidebar).removeClass(ClassName.open);
|
||||||
|
}
|
||||||
$(Selector.sidebar).fadeOut();
|
$(Selector.sidebar).fadeOut();
|
||||||
$(this.element).trigger($.Event(Event.collapsed));
|
$(this.element).trigger($.Event(Event.collapsed));
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,6 +41,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open without slide over content
|
// Open without slide over content
|
||||||
|
.control-sidebar-hold-transition {
|
||||||
|
.control-sidebar-bg,
|
||||||
|
.control-sidebar,
|
||||||
|
.content-wrapper {
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
.control-sidebar-open {
|
.control-sidebar-open {
|
||||||
.control-sidebar-bg,
|
.control-sidebar-bg,
|
||||||
.control-sidebar {
|
.control-sidebar {
|
||||||
|
|
|
@ -748,6 +748,11 @@ a:focus {
|
||||||
.control-sidebar.control-sidebar-open + .control-sidebar-bg {
|
.control-sidebar.control-sidebar-open + .control-sidebar-bg {
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
.control-sidebar-hold-transition .control-sidebar-bg,
|
||||||
|
.control-sidebar-hold-transition .control-sidebar,
|
||||||
|
.control-sidebar-hold-transition .content-wrapper {
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
.control-sidebar-open .control-sidebar-bg,
|
.control-sidebar-open .control-sidebar-bg,
|
||||||
.control-sidebar-open .control-sidebar {
|
.control-sidebar-open .control-sidebar {
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -749,6 +749,11 @@ a:focus {
|
||||||
.control-sidebar.control-sidebar-open + .control-sidebar-bg {
|
.control-sidebar.control-sidebar-open + .control-sidebar-bg {
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
.control-sidebar-hold-transition .control-sidebar-bg,
|
||||||
|
.control-sidebar-hold-transition .control-sidebar,
|
||||||
|
.control-sidebar-hold-transition .content-wrapper {
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
.control-sidebar-open .control-sidebar-bg,
|
.control-sidebar-open .control-sidebar-bg,
|
||||||
.control-sidebar-open .control-sidebar {
|
.control-sidebar-open .control-sidebar {
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -329,7 +329,7 @@ throw new Error('AdminLTE requires jQuery')
|
||||||
var DataKey = 'lte.controlsidebar';
|
var DataKey = 'lte.controlsidebar';
|
||||||
|
|
||||||
var Default = {
|
var Default = {
|
||||||
slide: true
|
controlsidebarSlide: true
|
||||||
};
|
};
|
||||||
|
|
||||||
var Selector = {
|
var Selector = {
|
||||||
|
@ -343,7 +343,8 @@ throw new Error('AdminLTE requires jQuery')
|
||||||
};
|
};
|
||||||
|
|
||||||
var ClassName = {
|
var ClassName = {
|
||||||
open : 'control-sidebar-open',
|
open: 'control-sidebar-open',
|
||||||
|
transition: 'control-sidebar-hold-transition',
|
||||||
fixed: 'fixed'
|
fixed: 'fixed'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -389,8 +390,11 @@ throw new Error('AdminLTE requires jQuery')
|
||||||
|
|
||||||
ControlSidebar.prototype.expand = function () {
|
ControlSidebar.prototype.expand = function () {
|
||||||
$(Selector.sidebar).show();
|
$(Selector.sidebar).show();
|
||||||
if (!this.options.slide) {
|
if (!this.options.controlsidebarSlide) {
|
||||||
$('body').addClass(ClassName.open);
|
$('body').addClass(ClassName.transition).addClass(ClassName.open).delay(50).queue(function(){
|
||||||
|
$('body').removeClass(ClassName.transition);
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
$(Selector.sidebar).addClass(ClassName.open);
|
$(Selector.sidebar).addClass(ClassName.open);
|
||||||
}
|
}
|
||||||
|
@ -400,7 +404,14 @@ throw new Error('AdminLTE requires jQuery')
|
||||||
};
|
};
|
||||||
|
|
||||||
ControlSidebar.prototype.collapse = function () {
|
ControlSidebar.prototype.collapse = function () {
|
||||||
$('body, ' + Selector.sidebar).removeClass(ClassName.open);
|
if (!this.options.controlsidebarSlide) {
|
||||||
|
$('body').addClass(ClassName.transition).removeClass(ClassName.open).delay(50).queue(function(){
|
||||||
|
$('body').removeClass(ClassName.transition);
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
$(Selector.sidebar).removeClass(ClassName.open);
|
||||||
|
}
|
||||||
$(Selector.sidebar).fadeOut();
|
$(Selector.sidebar).fadeOut();
|
||||||
$(this.element).trigger($.Event(Event.collapsed));
|
$(this.element).trigger($.Event(Event.collapsed));
|
||||||
};
|
};
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue