Skip to content

Commit

Permalink
Merge pull request #94 from aleevas/DS-1300
Browse files Browse the repository at this point in the history
[Ds-1300] Fix deprecation code (once and cookie) in js files
  • Loading branch information
svicervlad authored Jan 12, 2024
2 parents 56f5d96 + 2eb4a0e commit 5eceb28
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions modules/openy_gc_auth/js/auth.behaviors.js
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions modules/openy_gc_auth/openy_gc_auth.libraries.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5eceb28

Please sign in to comment.