Commit bf18cf43 authored by Michael Zetterberg fd. Lopez's avatar Michael Zetterberg fd. Lopez Committed by Sven Berg Ryen
Browse files

Issue #3272638: Body classes not updated on consent selection

parent b4f4c18c
Loading
Loading
Loading
Loading
+7 −1
Changes for js/eu_cookie_compliance.js: 7 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -673,6 +673,7 @@
          else {
            $('.sliding-popup-top').not('.eu-cookie-withdraw-wrapper').trigger('eu_cookie_compliance_popup_close').remove();
          }
          $('body').removeClass('eu-cookie-compliance-popup-open');
        }
        if (drupalSettings.eu_cookie_compliance.withdraw_enabled) {
          Drupal.eu_cookie_compliance.showWithdrawBanner(value);
@@ -699,8 +700,8 @@
          }
          else {
            $('.sliding-popup-bottom').not('.eu-cookie-withdraw-wrapper').trigger('eu_cookie_compliance_popup_close').remove();
            $('body').removeClass('eu-cookie-compliance-popup-open');
          }
          $('body').removeClass('eu-cookie-compliance-popup-open');
        }
        if (drupalSettings.eu_cookie_compliance.withdraw_enabled) {
          Drupal.eu_cookie_compliance.showWithdrawBanner(value);
@@ -777,6 +778,11 @@
      date.setDate(date.getDate() + lifetime);
      cookies.set(cookieName, status, { expires: date, path: path, domain: domain, sameSite: 'strict' });
    }

    var currentStatusClass = 'eu-cookie-compliance-status-' + _euccCurrentStatus;
    var nextStatusClass = 'eu-cookie-compliance-status-' + status;
    $('.' + currentStatusClass).removeClass(currentStatusClass).addClass(nextStatusClass)

    _euccCurrentStatus = status;
    $(document).trigger('eu_cookie_compliance.changeStatus', [status]);
    // Status set means something happened, update the version.