Unverified Commit cff472ef 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 33b04ad7
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -380,6 +380,7 @@ jquery.cookie:
    - core/jquery
    - core/drupal
    - core/js-cookie
    - core/drupal.object.assign

jquery.farbtastic:
  remote: https://github.com/mattfarina/farbtastic
@@ -1033,5 +1034,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
@@ -112,7 +112,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 = Object.assign({}, $.cookie.defaults, options);

      if (!$.cookie.json) {
        // An object that is passed in must be typecast to a string when the
@@ -187,7 +187,7 @@
   * @see https://github.com/js-cookie/js-cookie/blob/v2.2.1/README.md
   */
  $.removeCookie = (key, options) => {
    cookies.remove(key, Object.assign($.cookie.defaults, options));
    cookies.remove(key, Object.assign({}, $.cookie.defaults, options));
    return !cookies.get(key);
  };
})(jQuery, Drupal, window.Cookies);
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
    var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;

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

      if (!$.cookie.json) {
        value = String(value);
@@ -65,7 +65,7 @@
  $.cookie.raw = false;

  $.removeCookie = function (key, options) {
    cookies.remove(key, Object.assign($.cookie.defaults, options));
    cookies.remove(key, Object.assign({}, $.cookie.defaults, options));
    return !cookies.get(key);
  };
})(jQuery, Drupal, window.Cookies);
 No newline at end of file