Skip to content
Snippets Groups Projects
Commit 6dd42183 authored by Tiago's avatar Tiago Committed by Tiago Siqueira
Browse files

Remove jquery .once() dependency and migrate to core/once

Since this was deprecated on D10, we need to change how we are using .once() functions and change for the new one once() provided by core itself
parent 28c9a320
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@
* support push notifications or service workers.
*/
(function ($, Drupal) {
(function ($, Drupal, once) {
'use strict';
......@@ -35,7 +35,7 @@
}
// Ensure this is only executed once.
if ($("body").once('social_pwa-attach').length !== 1) {
if (once('social_pwa-attach', 'body').length !== 1) {
return;
}
......@@ -511,4 +511,4 @@
return window.btoa(binary);
}
})(jQuery, Drupal);
})(jQuery, Drupal, once);
......@@ -3,6 +3,7 @@ main-js:
js/main.js: {}
dependencies:
- core/jquery
- core/once
- core/drupal
- core/drupalSettings
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment