Skip to content

Commit

Permalink
IBX-5854: Unified cookies names
Browse files Browse the repository at this point in the history
  • Loading branch information
dew326 committed Sep 25, 2023
1 parent e48263d commit 29b0a1f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/bundle/Resources/public/js/scripts/sidebar/main.menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
}
};
const setWidthOfSecondLevelMenu = () => {
const secondLevelMenuWidth = ibexa.helpers.cookies.getCookie('second_menu_width');
const secondLevelMenuWidth = ibexa.helpers.cookies.getCookie('ibexa_menu-secondary-width');
const isSecondLevelMenuHidden = secondLevelMenuNode.classList.contains('ibexa-main-menu__navbar--hidden');

if (!secondLevelMenuWidth || isSecondLevelMenuHidden) {
Expand All @@ -81,7 +81,7 @@
const isSecondLevelMenuCollapsed = secondLevelMenuNode.classList.contains('ibexa-main-menu__navbar--collapsed');
const newMenuWidth = isSecondLevelMenuCollapsed ? SECOND_LEVEL_EXPANDED_WIDTH : SECOND_LEVEL_COLLAPSED_WIDTH;

ibexa.helpers.cookies.setBackOfficeCookie('second_menu_width', newMenuWidth);
ibexa.helpers.cookies.setBackOfficeCookie('ibexa_menu-secondary-width', newMenuWidth);
setWidthOfSecondLevelMenu();
};
const parsePopup = (button) => {
Expand Down Expand Up @@ -131,7 +131,7 @@
const resizeValue = secondMenuLevelCurrentWidth + (clientX - resizeStartPositionX);
const newMenuWidth = resizeValue > SECOND_LEVEL_MANUAL_RESIZE_MIN_WIDTH ? resizeValue : SECOND_LEVEL_COLLAPSED_WIDTH;

ibexa.helpers.cookies.setBackOfficeCookie('second_menu_width', newMenuWidth);
ibexa.helpers.cookies.setBackOfficeCookie('ibexa_menu-secondary-width', newMenuWidth);
setWidthOfSecondLevelMenu();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{% block body_class %}ibexa-content-view{% endblock %}

{% block content_tree %}
{% set container_width_cookie = 'ibexa-tb-ibexa-content-tree-%d-container-width'|format(ibexa_admin_ui_config.user.user.id) %}
{% set container_width_cookie = 'ibexa-tb_ibexa-content-tree_%d_container-width'|format(ibexa_admin_ui_config.user.user.id) %}
{% set content_tree_width = app.request.cookies.get(container_width_cookie) %}
{% set content_tree_width_style = 'width: %dpx;'|format(content_tree_width) %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% trans_default_domain 'adaptive_filters' %}

{% if filters_id is defined %}
{% set expanded_info_cookie_name = 'ibexa_adaptive_filters-is_expanded-' ~ filters_id %}
{% set expanded_info_cookie_name = 'ibexa-af_is-expanded_' ~ filters_id|replace({'_': '-'}) %}
{% endif %}

{% set is_expanded_cookie = expanded_info_cookie_name is defined and app.request.cookies.get(expanded_info_cookie_name) == 'true' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block root %}
{% set resizer_width = 10 %}
{% set second_level_manual_resize_min_width = 80 %}
{% set second_level_menu_width = app.request.cookies.get('second_menu_width') %}
{% set second_level_menu_width = app.request.cookies.get('ibexa_menu-secondary-width') %}
{% set second_menu_width_style = '' %}
{% set second_menu_list_width_style = '' %}
{% set extra_class = 'ibexa-main-menu__navbar--hidden' %}
Expand Down

0 comments on commit 29b0a1f

Please sign in to comment.