Skip to content

Commit

Permalink
Fix issue #1547
Browse files Browse the repository at this point in the history
  • Loading branch information
almasaeed2010 committed Jun 25, 2017
1 parent 4b0d73b commit fbbc450
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 41 deletions.
19 changes: 13 additions & 6 deletions build/js/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
sidebar : '.sidebar',
controlSidebar: '.control-sidebar',
fixed : '.fixed',
sidebarMenu : '.sidebar-menu'
sidebarMenu : '.sidebar-menu',
logo : '.main-header .logo'
}

var ClassName = {
Expand Down Expand Up @@ -57,7 +58,13 @@
$(window).resize(function () {
this.fix()
this.fixSidebar()

$(Selector.logo + ', ' + Selector.sidebar).one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function () {
this.fix()
this.fixSidebar()
}.bind(this))
}.bind(this))

this.bindedResize = true
}

Expand All @@ -82,25 +89,25 @@
var windowHeight = $(window).height()
var sidebarHeight = $(Selector.sidebar).height() || 0

// Set the min-height of the content and sidebar based on the
// Set the min-height of the content and sidebar based on
// the height of the document.
if ($('body').hasClass(ClassName.fixed)) {
$(Selector.contentWrapper).css('min-height', windowHeight - footerHeight)
} else {
var postSetWidth
var postSetHeight

if (windowHeight >= sidebarHeight) {
$(Selector.contentWrapper).css('min-height', windowHeight - neg)
postSetWidth = windowHeight - neg
postSetHeight = windowHeight - neg
} else {
$(Selector.contentWrapper).css('min-height', sidebarHeight)
postSetWidth = sidebarHeight
postSetHeight = sidebarHeight
}

// Fix for the control sidebar height
var $controlSidebar = $(Selector.controlSidebar)
if (typeof $controlSidebar !== 'undefined') {
if ($controlSidebar.height() > postSetWidth)
if ($controlSidebar.height() > postSetHeight)
$(Selector.contentWrapper).css('min-height', $controlSidebar.height())
}
}
Expand Down
21 changes: 11 additions & 10 deletions build/less/sidebar.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,34 @@
* Component: Sidebar
* ------------------
*/
//Main Sidebar
// ``` .left-side has been deprecated as of 2.0.0 in favor of .main-sidebar ```

.main-sidebar,
.left-side {
// Main Sidebar
.main-sidebar {
position: absolute;
top: 0;
left: 0;
padding-top: 50px;
min-height: 100%;
width: @sidebar-width;
z-index: 810;
//Using disposable variable to join statements with a comma
@transition-rule: @transition-speed @transition-fn,
width @transition-speed @transition-fn;

// Using disposable variable to join statements with a comma
@transition-rule: @transition-speed @transition-fn, width @transition-speed @transition-fn;
.transition-transform(@transition-rule);

@media (max-width: @screen-header-collapse) {
padding-top: 100px;
}

@media (max-width: @screen-xs-max) {
.translate(-@sidebar-width, 0);
}

.sidebar-collapse & {
@media (min-width: @screen-sm) {
.translate(-@sidebar-width, 0);
}
}

.sidebar-open & {
@media (max-width: @screen-xs-max) {
.translate(0, 0);
Expand All @@ -40,14 +41,14 @@
padding-bottom: 10px;
}

// remove border from form
// Remove border from form
.sidebar-form {
input:focus {
border-color: transparent;
}
}

//Sidebar user panel
// Sidebar user panel
.user-panel {
position: relative;
width: 100%;
Expand Down
15 changes: 5 additions & 10 deletions dist/css/AdminLTE.css
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,7 @@ a:focus {
* Component: Sidebar
* ------------------
*/
.main-sidebar,
.left-side {
.main-sidebar {
position: absolute;
top: 0;
left: 0;
Expand All @@ -430,32 +429,28 @@ a:focus {
transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
}
@media (max-width: 767px) {
.main-sidebar,
.left-side {
.main-sidebar {
padding-top: 100px;
}
}
@media (max-width: 767px) {
.main-sidebar,
.left-side {
.main-sidebar {
-webkit-transform: translate(-230px, 0);
-ms-transform: translate(-230px, 0);
-o-transform: translate(-230px, 0);
transform: translate(-230px, 0);
}
}
@media (min-width: 768px) {
.sidebar-collapse .main-sidebar,
.sidebar-collapse .left-side {
.sidebar-collapse .main-sidebar {
-webkit-transform: translate(-230px, 0);
-ms-transform: translate(-230px, 0);
-o-transform: translate(-230px, 0);
transform: translate(-230px, 0);
}
}
@media (max-width: 767px) {
.sidebar-open .main-sidebar,
.sidebar-open .left-side {
.sidebar-open .main-sidebar {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
-o-transform: translate(0, 0);
Expand Down
2 changes: 1 addition & 1 deletion dist/css/AdminLTE.min.css

Large diffs are not rendered by default.

15 changes: 5 additions & 10 deletions dist/css/alt/AdminLTE-without-plugins.css
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,7 @@ a:focus {
* Component: Sidebar
* ------------------
*/
.main-sidebar,
.left-side {
.main-sidebar {
position: absolute;
top: 0;
left: 0;
Expand All @@ -431,32 +430,28 @@ a:focus {
transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
}
@media (max-width: 767px) {
.main-sidebar,
.left-side {
.main-sidebar {
padding-top: 100px;
}
}
@media (max-width: 767px) {
.main-sidebar,
.left-side {
.main-sidebar {
-webkit-transform: translate(-230px, 0);
-ms-transform: translate(-230px, 0);
-o-transform: translate(-230px, 0);
transform: translate(-230px, 0);
}
}
@media (min-width: 768px) {
.sidebar-collapse .main-sidebar,
.sidebar-collapse .left-side {
.sidebar-collapse .main-sidebar {
-webkit-transform: translate(-230px, 0);
-ms-transform: translate(-230px, 0);
-o-transform: translate(-230px, 0);
transform: translate(-230px, 0);
}
}
@media (max-width: 767px) {
.sidebar-open .main-sidebar,
.sidebar-open .left-side {
.sidebar-open .main-sidebar {
-webkit-transform: translate(0, 0);
-ms-transform: translate(0, 0);
-o-transform: translate(0, 0);
Expand Down
2 changes: 1 addition & 1 deletion dist/css/alt/AdminLTE-without-plugins.min.css

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions dist/js/adminlte.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ throw new Error('AdminLTE requires jQuery')
sidebar : '.sidebar',
controlSidebar: '.control-sidebar',
fixed : '.fixed',
sidebarMenu : '.sidebar-menu'
sidebarMenu : '.sidebar-menu',
logo : '.main-header .logo'
}

var ClassName = {
Expand Down Expand Up @@ -76,7 +77,13 @@ throw new Error('AdminLTE requires jQuery')
$(window).resize(function () {
this.fix()
this.fixSidebar()

$(Selector.logo + ', ' + Selector.sidebar).one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function () {
this.fix()
this.fixSidebar()
}.bind(this))
}.bind(this))

this.bindedResize = true
}

Expand All @@ -101,7 +108,7 @@ throw new Error('AdminLTE requires jQuery')
var windowHeight = $(window).height()
var sidebarHeight = $(Selector.sidebar).height() || 0

// Set the min-height of the content and sidebar based on the
// Set the min-height of the content and sidebar based on
// the height of the document.
if ($('body').hasClass(ClassName.fixed)) {
$(Selector.contentWrapper).css('min-height', windowHeight - footerHeight)
Expand Down
2 changes: 1 addition & 1 deletion dist/js/adminlte.min.js

Large diffs are not rendered by default.

0 comments on commit fbbc450

Please sign in to comment.