This commit is contained in:
harukin 2018-11-16 22:07:17 +09:00
parent b9cf2f3433
commit 06a382af59
2 changed files with 28 additions and 18 deletions

View File

@ -33,6 +33,12 @@ $(document).ready(function () {
}
});
$('section').on('click', function () {
if ($('main').hasClass('region_3-on')) {
toggleBside();
}
});
var left_aside_height = $('#left_aside_wrapper').height();
$('#left_aside_wrapper').on('click', function () {
@ -127,3 +133,24 @@ function toggleAside() {
});
}
}
function toggleBside() {
if ($('main').hasClass('region_3-on')) {
$('html, body').css('overflow-x', '');
$('main').removeClass('region_3-on')
$('region_3').addClass('d-none')
$('#overlay').remove();
$('#right_aside_wrapper').trigger("sticky_kit:detach");
}
else {
$('html, body').css('overflow-x', 'hidden');
$('main').addClass('region_3-on')
$('region_3').removeClass('d-none')
$('<div id="overlay"></div>').appendTo('section');
$('#right_aside_wrapper').stick_in_parent({
offset_top: $('nav').outerHeight(true) + 10,
parent: '#region_3',
spacer: '#right_aside_spacer'
});
}
}

View File

@ -5,24 +5,7 @@
$(document).ready(function() {
notifications_parent = $('#notifications_wrapper')[0].parentElement.id;
$('.notifications-btn').click(function() {
$('#notifications-btn-1');
if ($('main').hasClass('region_3-on')) {
$('html, body').css('overflow-x', '');
$('main').removeClass('region_3-on')
$('#overlay').remove();
$('#right_aside_wrapper').trigger("sticky_kit:detach");
}
else {
$('html, body').css('overflow-x', 'hidden');
$('main').addClass('region_3-on')
$('<div id="overlay"></div>').appendTo('section');
$('#right_aside_wrapper').stick_in_parent({
offset_top: $('nav').outerHeight(true) + 10,
parent: '#region_3',
spacer: '#right_aside_spacer'
});
}
toggleBside();
});
window.onpopstate = function(e) {