diff --git a/view/theme/plusfuture/js/plusfuture.js b/view/theme/plusfuture/js/plusfuture.js index 8ed8131..7c3f304 100644 --- a/view/theme/plusfuture/js/plusfuture.js +++ b/view/theme/plusfuture/js/plusfuture.js @@ -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') + $('
').appendTo('section'); + $('#right_aside_wrapper').stick_in_parent({ + offset_top: $('nav').outerHeight(true) + 10, + parent: '#region_3', + spacer: '#right_aside_spacer' + }); + } +} \ No newline at end of file diff --git a/view/theme/plusfuture/tpl/notifications_widget.tpl b/view/theme/plusfuture/tpl/notifications_widget.tpl index bd00bc8..6843fe1 100644 --- a/view/theme/plusfuture/tpl/notifications_widget.tpl +++ b/view/theme/plusfuture/tpl/notifications_widget.tpl @@ -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') - $('
').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) {