mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Fixes a weird issue where a fixed sidebar cannot be accessed on small screens
This commit is contained in:
parent
cfbc004815
commit
bc317ffbb8
@ -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() {
|
||||
|
@ -46,11 +46,13 @@ body.display-side-panel {
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: @screen-md-min) {
|
||||
body.side-panel-fix-shadow {
|
||||
#layout-side-panel {
|
||||
.box-shadow(none);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.touch #layout-side-panel .fix-button {
|
||||
display: none;
|
||||
|
Loading…
x
Reference in New Issue
Block a user