Unverified Commit 97b964b1 authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #2550717 follow-up by droplet, bnjmnm, tedbow, lauriii: [JS] Replace...

Issue #2550717 follow-up by droplet, bnjmnm, tedbow, lauriii: [JS] Replace jQuery.cookie with JS-cookie and provide a BC layer
parent 63adf59d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -666,5 +666,3 @@ js-cookie:
    gpl-compatible: true
  js:
    assets/vendor/js-cookie/js.cookie.min.js: {}
  dependencies:
    - core/drupal.object.assign
+2 −2
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@
    if (value !== undefined && !isFunction(value)) {
      // The caller is setting a cookie value and not trying to retrieve the
      // cookie value using a converter callback.
      const attributes = Object.assign($.cookie.defaults, options);
      const attributes = { ...$.cookie.defaults, ...options };

      if (!$.cookie.json) {
        // An object that is passed in must be typecast to a string when the
@@ -201,7 +201,7 @@
    Drupal.deprecationError({
      message: `jQuery.removeCookie() ${deprecatedMessageSuffix}`,
    });
    cookies.remove(key, Object.assign($.cookie.defaults, options));
    cookies.remove(key, { ...$.cookie.defaults, ...options });
    return !cookies.get(key);
  };
})(jQuery, Drupal, window.Cookies);
+2 −2
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
    });

    if (value !== undefined && !isFunction(value)) {
      var attributes = Object.assign($.cookie.defaults, options);
      var attributes = _objectSpread({}, $.cookie.defaults, {}, options);

      if (!$.cookie.json) {
        value = String(value);
@@ -79,7 +79,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
    Drupal.deprecationError({
      message: "jQuery.removeCookie() ".concat(deprecatedMessageSuffix)
    });
    cookies.remove(key, Object.assign($.cookie.defaults, options));
    cookies.remove(key, _objectSpread({}, $.cookie.defaults, {}, options));
    return !cookies.get(key);
  };
})(jQuery, Drupal, window.Cookies);
 No newline at end of file