diff --git a/themes/beauty/views/site/index.php b/themes/beauty/views/site/index.php index 85a1ede..85936c1 100644 --- a/themes/beauty/views/site/index.php +++ b/themes/beauty/views/site/index.php @@ -10,6 +10,11 @@ $supportedExts = array_merge($imgExts, $videoExts); $authConfig = FSC::$app['config']['password_auth']; $dir_ext_status = !empty($_COOKIE['dir_ext_status']) ? $_COOKIE['dir_ext_status'] : 'opened'; +$menu_ext_status = !empty($_COOKIE['menu_ext_status']) ? $_COOKIE['menu_ext_status'] : 'opened'; + +$menu_expand_icon_cls = $menu_ext_status == 'opened' ? '' : 'closed'; +$menu_expand_icon_url = $menu_ext_status == 'opened' ? 'arrow-left-circle.svg' : 'arrow-right-circle.svg'; +$main_view_cls = $menu_ext_status == 'opened' ? '' : 'full'; ?> -
+
+ + + diff --git a/www/img/beauty/arrow-right-circle.svg b/www/img/beauty/arrow-right-circle.svg new file mode 100644 index 0000000..cf884b7 --- /dev/null +++ b/www/img/beauty/arrow-right-circle.svg @@ -0,0 +1,4 @@ + + + + diff --git a/www/js/beauty.js b/www/js/beauty.js index 3b718c4..89a3c70 100644 --- a/www/js/beauty.js +++ b/www/js/beauty.js @@ -786,6 +786,27 @@ $('.btn-dir-ext').click(function(evt) { $('.btn-dir-ext').find('img').attr('src', '/img/arrow-up.svg'); $('.btn-dir-ext').find('span').text(opened_title); + Cookies.set(cookieKey, 'opened', { expires: 1 }); + } +}); + +$('.expand-icon').click(function(evt) { + var cookieKey = 'menu_ext_status'; + var status = $('.expand-icon').attr('data-status'); + + if (!status || status == 'opened') { + $('.expand-icon').attr('data-status', 'closed'); + $('.img_main').addClass('full'); + $('.expand-icon img').attr('src', '/img/beauty/arrow-right-circle.svg'); + $('.navbar-fixed-left').addClass('closed'); + + Cookies.set(cookieKey, 'closed', { expires: 1 }); + }else { + $('.expand-icon').attr('data-status', 'opened'); + $('.img_main').removeClass('full'); + $('.expand-icon img').attr('src', '/img/beauty/arrow-left-circle.svg'); + $('.navbar-fixed-left').removeClass('closed'); + Cookies.set(cookieKey, 'opened', { expires: 1 }); } }); \ No newline at end of file