diff --git a/modules/openy_gc_auth/js/auth.behaviors.js b/modules/openy_gc_auth/js/auth.behaviors.js index 020ae4511..384141fa1 100644 --- a/modules/openy_gc_auth/js/auth.behaviors.js +++ b/modules/openy_gc_auth/js/auth.behaviors.js @@ -1,4 +1,4 @@ -(function ($, Drupal) { +(function ($, Drupal, cookies) { Drupal.behaviors.openy_gc_auth_store_hash = { attach: function (context) { // Only run this script on full documents, not ajax requests. @@ -8,7 +8,7 @@ if (!window.location.hash || window.location.hash === '#') { return; } - $.cookie('openy_gc_auth_destination', window.location.hash); + cookies.set('openy_gc_auth_destination', window.location.hash); } } -})(jQuery, Drupal); +})(jQuery, Drupal, window.Cookies); diff --git a/modules/openy_gc_auth/modules/openy_gc_auth_example/js/openy_gc_auth_example.js b/modules/openy_gc_auth/modules/openy_gc_auth_example/js/openy_gc_auth_example.js index 008c1c348..d07a8bd9c 100644 --- a/modules/openy_gc_auth/modules/openy_gc_auth_example/js/openy_gc_auth_example.js +++ b/modules/openy_gc_auth/modules/openy_gc_auth_example/js/openy_gc_auth_example.js @@ -2,12 +2,13 @@ * @file * JavaScript for openy_gc_auth_example. */ -(function ($, Drupal) { +(function ($, Drupal, once) { Drupal.behaviors.openy_gc_auth_example = { attach: function(context, settings) { - $('input[data-autosubmit=1]', context).once('openy_gc_auth_example').form().submit(); + $(once('openy_gc_auth-data-autosubmit', 'input[data-autosubmit=1]')) + .form().submit(); } }; -})(jQuery, Drupal); +})(jQuery, Drupal, once); diff --git a/modules/openy_gc_auth/modules/openy_gc_auth_example/openy_gc_auth_example.libraries.yml b/modules/openy_gc_auth/modules/openy_gc_auth_example/openy_gc_auth_example.libraries.yml index add814fa4..04739581b 100644 --- a/modules/openy_gc_auth/modules/openy_gc_auth_example/openy_gc_auth_example.libraries.yml +++ b/modules/openy_gc_auth/modules/openy_gc_auth_example/openy_gc_auth_example.libraries.yml @@ -1,6 +1,7 @@ openy_gc_auth_example: - version: 1.0 + version: 1.1 js: js/openy_gc_auth_example.js: { minified: false } dependencies: - core/jquery + - core/once diff --git a/modules/openy_gc_auth/openy_gc_auth.libraries.yml b/modules/openy_gc_auth/openy_gc_auth.libraries.yml index 3e5752d0c..9197a5161 100644 --- a/modules/openy_gc_auth/openy_gc_auth.libraries.yml +++ b/modules/openy_gc_auth/openy_gc_auth.libraries.yml @@ -1,7 +1,7 @@ auth_destination: - version: 0.1 + version: 0.2 js: js/auth.behaviors.js: {} dependencies: - core/jquery - - core/jquery.cookie + - core/js-cookie