mirror of https://github.com/ColorlibHQ/AdminLTE
reworked control-sidebar & removed overflow from wrapper and html
- added display none/block to control-sidebar to avoid sidewards scrolling - reworked ControlSidebar.js with queue to add and remove .control-sidebar-animate from html to avoid overflowpull/2153/head
parent
9edbe410c9
commit
94d37b5520
|
@ -28,8 +28,9 @@ const ControlSidebar = (($) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const ClassName = {
|
const ClassName = {
|
||||||
CONTROL_SIDEBAR_OPEN : 'control-sidebar-open',
|
CONTROL_SIDEBAR_ANIMATE: 'control-sidebar-animate',
|
||||||
CONTROL_SIDEBAR_SLIDE: 'control-sidebar-slide-open'
|
CONTROL_SIDEBAR_OPEN : 'control-sidebar-open',
|
||||||
|
CONTROL_SIDEBAR_SLIDE : 'control-sidebar-slide-open'
|
||||||
}
|
}
|
||||||
|
|
||||||
const Default = {
|
const Default = {
|
||||||
|
@ -52,7 +53,12 @@ const ControlSidebar = (($) => {
|
||||||
show() {
|
show() {
|
||||||
// Show the control sidebar
|
// Show the control sidebar
|
||||||
if (this._config.slide) {
|
if (this._config.slide) {
|
||||||
$('body').removeClass(ClassName.CONTROL_SIDEBAR_SLIDE)
|
$('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
|
||||||
|
$('body').removeClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function(){
|
||||||
|
$(Selector.CONTROL_SIDEBAR).hide()
|
||||||
|
$('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
$('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN)
|
$('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN)
|
||||||
}
|
}
|
||||||
|
@ -61,7 +67,14 @@ const ControlSidebar = (($) => {
|
||||||
collapse() {
|
collapse() {
|
||||||
// Collapse the control sidebar
|
// Collapse the control sidebar
|
||||||
if (this._config.slide) {
|
if (this._config.slide) {
|
||||||
$('body').addClass(ClassName.CONTROL_SIDEBAR_SLIDE)
|
$('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
|
||||||
|
$(Selector.CONTROL_SIDEBAR).show().delay(100).queue(function(){
|
||||||
|
$('body').addClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function(){
|
||||||
|
$('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE)
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
|
$(this).dequeue()
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
$('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN)
|
$('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN)
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
* --------------------------
|
* --------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
html.control-sidebar-animate {
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.control-sidebar {
|
.control-sidebar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: $main-header-height;
|
top: $main-header-height;
|
||||||
|
@ -11,6 +15,7 @@
|
||||||
&,
|
&,
|
||||||
&::before {
|
&::before {
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
display: none;
|
||||||
right: -$control-sidebar-width;
|
right: -$control-sidebar-width;
|
||||||
width: $control-sidebar-width;
|
width: $control-sidebar-width;
|
||||||
@include transition(right $transition-speed $transition-fn);
|
@include transition(right $transition-speed $transition-fn);
|
||||||
|
@ -29,6 +34,8 @@
|
||||||
.control-sidebar-open {
|
.control-sidebar-open {
|
||||||
@include media-breakpoint-up(md) {
|
@include media-breakpoint-up(md) {
|
||||||
.control-sidebar {
|
.control-sidebar {
|
||||||
|
display: block;
|
||||||
|
|
||||||
&,
|
&,
|
||||||
&::before {
|
&::before {
|
||||||
right: 0;
|
right: 0;
|
||||||
|
@ -54,6 +61,8 @@
|
||||||
// Control sidebar slide over content state
|
// Control sidebar slide over content state
|
||||||
.control-sidebar-slide-open {
|
.control-sidebar-slide-open {
|
||||||
.control-sidebar {
|
.control-sidebar {
|
||||||
|
display: block;
|
||||||
|
|
||||||
&,
|
&,
|
||||||
&::before {
|
&::before {
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|
|
@ -11,11 +11,9 @@ html,
|
||||||
body,
|
body,
|
||||||
.wrapper {
|
.wrapper {
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
overflow-x: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
& .content-wrapper {
|
& .content-wrapper {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -29,6 +29,7 @@
|
||||||
MAIN_HEADER: '.main-header'
|
MAIN_HEADER: '.main-header'
|
||||||
};
|
};
|
||||||
var ClassName = {
|
var ClassName = {
|
||||||
|
CONTROL_SIDEBAR_ANIMATE: 'control-sidebar-animate',
|
||||||
CONTROL_SIDEBAR_OPEN: 'control-sidebar-open',
|
CONTROL_SIDEBAR_OPEN: 'control-sidebar-open',
|
||||||
CONTROL_SIDEBAR_SLIDE: 'control-sidebar-slide-open'
|
CONTROL_SIDEBAR_SLIDE: 'control-sidebar-slide-open'
|
||||||
};
|
};
|
||||||
|
@ -55,7 +56,12 @@
|
||||||
_proto.show = function show() {
|
_proto.show = function show() {
|
||||||
// Show the control sidebar
|
// Show the control sidebar
|
||||||
if (this._config.slide) {
|
if (this._config.slide) {
|
||||||
$('body').removeClass(ClassName.CONTROL_SIDEBAR_SLIDE);
|
$('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE);
|
||||||
|
$('body').removeClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function () {
|
||||||
|
$(Selector.CONTROL_SIDEBAR).hide();
|
||||||
|
$('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE);
|
||||||
|
$(this).dequeue();
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
$('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN);
|
$('body').removeClass(ClassName.CONTROL_SIDEBAR_OPEN);
|
||||||
}
|
}
|
||||||
|
@ -64,7 +70,14 @@
|
||||||
_proto.collapse = function collapse() {
|
_proto.collapse = function collapse() {
|
||||||
// Collapse the control sidebar
|
// Collapse the control sidebar
|
||||||
if (this._config.slide) {
|
if (this._config.slide) {
|
||||||
$('body').addClass(ClassName.CONTROL_SIDEBAR_SLIDE);
|
$('html').addClass(ClassName.CONTROL_SIDEBAR_ANIMATE);
|
||||||
|
$(Selector.CONTROL_SIDEBAR).show().delay(100).queue(function () {
|
||||||
|
$('body').addClass(ClassName.CONTROL_SIDEBAR_SLIDE).delay(300).queue(function () {
|
||||||
|
$('html').removeClass(ClassName.CONTROL_SIDEBAR_ANIMATE);
|
||||||
|
$(this).dequeue();
|
||||||
|
});
|
||||||
|
$(this).dequeue();
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
$('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN);
|
$('body').addClass(ClassName.CONTROL_SIDEBAR_OPEN);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue