Fixes a weird issue where a fixed sidebar cannot be accessed on small screens

This commit is contained in:
Samuel Georges 2015-03-06 17:31:54 +11:00
parent cfbc004815
commit bc317ffbb8
4 changed files with 22 additions and 14 deletions

View File

@ -37,8 +37,8 @@
this.$list.dragScroll({
vertical: true,
start: function(){self.$list.addClass('drag')},
stop: function(){self.$list.removeClass('drag')},
start: function(){ self.$list.addClass('drag') },
stop: function(){ self.$list.removeClass('drag') },
scrollClassContainer: self.$el,
scrollMarkerContainer: self.$el
})

View File

@ -126,8 +126,9 @@
SidePanelTab.prototype.hideSidePanel = function() {
$(document.body).removeClass('display-side-panel')
if (this.$el.next('#layout-body').length == 0)
if (this.$el.next('#layout-body').length == 0) {
$('#layout-body').before(this.$el)
}
this.panelVisible = false
@ -135,25 +136,30 @@
}
SidePanelTab.prototype.updatePanelPosition = function() {
if (!this.panelFixed() || Modernizr.touch)
if (!this.panelFixed() || Modernizr.touch) {
this.$el.height($(document).height() - this.mainNavHeight)
else
}
else {
this.$el.css('height', '')
}
if (this.panelVisible && $(window).width() > this.options.breakpoint && this.panelFixed())
if (this.panelVisible && $(window).width() > this.options.breakpoint && this.panelFixed()) {
this.hideSidePanel()
}
}
SidePanelTab.prototype.updateActiveTab = function() {
if (!this.panelVisible && ($(window).width() < this.options.breakpoint || !this.panelFixed()))
if (!this.panelVisible && ($(window).width() < this.options.breakpoint || !this.panelFixed())) {
this.$sideNavItems.removeClass('active')
}
else {
this.$sideNavItems.filter('[data-menu-item='+this.visibleItemId+']').addClass('active')
}
}
SidePanelTab.prototype.panelFixed = function() {
return !$(document.body).hasClass('side-panel-not-fixed')
return !($(window).width() < this.options.breakpoint) &&
!$(document.body).hasClass('side-panel-not-fixed')
}
SidePanelTab.prototype.fixPanel = function() {

View File

@ -87,7 +87,7 @@
#layout-sidenav.layout-sidenav ul.drag li:not(.active) a:hover,
.touch #layout-sidenav.layout-sidenav li:not(.active) a:hover {
color: @color-sidebarnav-inactive-text!important;
i {color: @color-sidebarnav-inactive-icon!important;}
&:after {display: none!important;}
color: @color-sidebarnav-inactive-text !important;
i { color: @color-sidebarnav-inactive-icon !important; }
&:after { display: none !important; }
}

View File

@ -46,9 +46,11 @@ body.display-side-panel {
}
}
body.side-panel-fix-shadow {
#layout-side-panel {
.box-shadow(none);
@media (min-width: @screen-md-min) {
body.side-panel-fix-shadow {
#layout-side-panel {
.box-shadow(none);
}
}
}