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() {
|
SidePanelTab.prototype.hideSidePanel = function() {
|
||||||
$(document.body).removeClass('display-side-panel')
|
$(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)
|
$('#layout-body').before(this.$el)
|
||||||
|
}
|
||||||
|
|
||||||
this.panelVisible = false
|
this.panelVisible = false
|
||||||
|
|
||||||
@ -135,25 +136,30 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
SidePanelTab.prototype.updatePanelPosition = function() {
|
SidePanelTab.prototype.updatePanelPosition = function() {
|
||||||
if (!this.panelFixed() || Modernizr.touch)
|
if (!this.panelFixed() || Modernizr.touch) {
|
||||||
this.$el.height($(document).height() - this.mainNavHeight)
|
this.$el.height($(document).height() - this.mainNavHeight)
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
this.$el.css('height', '')
|
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()
|
this.hideSidePanel()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SidePanelTab.prototype.updateActiveTab = function() {
|
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')
|
this.$sideNavItems.removeClass('active')
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
this.$sideNavItems.filter('[data-menu-item='+this.visibleItemId+']').addClass('active')
|
this.$sideNavItems.filter('[data-menu-item='+this.visibleItemId+']').addClass('active')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SidePanelTab.prototype.panelFixed = function() {
|
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() {
|
SidePanelTab.prototype.fixPanel = function() {
|
||||||
|
@ -46,11 +46,13 @@ body.display-side-panel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (min-width: @screen-md-min) {
|
||||||
body.side-panel-fix-shadow {
|
body.side-panel-fix-shadow {
|
||||||
#layout-side-panel {
|
#layout-side-panel {
|
||||||
.box-shadow(none);
|
.box-shadow(none);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.touch #layout-side-panel .fix-button {
|
.touch #layout-side-panel .fix-button {
|
||||||
display: none;
|
display: none;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user