Quick-fix mobile menu

Will be reworked asap.
This commit is contained in:
Eric Lippmann 2015-12-21 14:06:42 +01:00
parent 95879dd26f
commit 887a688781
1 changed files with 46 additions and 22 deletions

View File

@ -525,25 +525,7 @@
$('a.close-toggle').show();
},
fixControls: function ($parent) {
var self = this;
if ($('#layout').hasClass('fullscreen-layout')) {
return;
}
if ('undefined' === typeof $parent) {
if (! $('#layout').hasClass('fullscreen-layout')) {
$('#header').css({height: 'auto'});
if ($('#layout').hasClass('minimal-layout')) {
if (! this.mobileMenu) {
$('#header').css({top: $('#sidebar').height() + 'px'});
$('#main').css({
top: $('#header').height() + $('#sidebar').height()
});
$('#sidebar').css({
zIndex: 2
}).on('click', function (e) {
toggleMobileMenu: function(e) {
var $sidebar = $('#sidebar');
var $target = $(e.target);
var href = $target.attr('href');
@ -559,7 +541,38 @@
$sidebar.removeClass('expanded');
}
});
}).prepend('<i class="icon-menu" style="vertical-align: middle;"></i>').css({
},
fixControls: function ($parent) {
var self = this;
if ($('#layout').hasClass('fullscreen-layout')) {
return;
}
if ('undefined' === typeof $parent) {
if (! $('#layout').hasClass('fullscreen-layout')) {
$('#header').css({height: 'auto'});
if ($('#layout').hasClass('minimal-layout')) {
if (! this.mobileMenu) {
$('#header-logo').css({
display: 'none'
});
$('#header').css({top: $('#sidebar').outerHeight() + 'px'});
$('#main').css({
top: $('#header').height() + $('#sidebar').outerHeight(),
zIndex: 1
});
$('#sidebar')
.css({
top: 0,
zIndex: 2
})
.on('click', this.toggleMobileMenu)
.prepend(
'<i id="mobile-menu-toggle" class="icon-menu" style="vertical-align: middle;"></i>'
)
.css({
paddingBottom: 32
});
this.mobileMenu = true;
@ -567,6 +580,17 @@
} else {
$('#main').css({top: $('#header').css('height')});
$('#sidebar').css({top: $('#header').height() + 'px'});
if (this.mobileMenu) {
$('#header-logo').css({
display: 'block'
});
$('#sidebar').off('click', this.toggleMobileMenu);
$('#header').css({
top: 0
});
$('#mobile-menu-toggle').remove();
this.mobileMenu = false;
}
}
$('#header').css({height: $('#header').height() + 'px'});
$('#inner-layout').css({top: $('#header').css('height')});