Skip to content
Snippets Groups Projects
Commit 48a2f2cc authored by Andrei Condurachi's avatar Andrei Condurachi Committed by Vladimir Roudakov
Browse files

Issue #3281658 by andreic, VladimirAus: Drupal 10 compatibility

parent 156c747b
Branches
Tags
No related merge requests found
......@@ -2,9 +2,10 @@
* @file
* Responsive navigation tabs (local tasks)
*
* Element requires to have class .is-collapsible and attribute [data-drupal-nav-tabs]
* Element requires to have class .is-collapsible and attribute
* [data-drupal-nav-tabs]
*/
(($, Drupal) => {
(($, Drupal, once) => {
function init(i, tab) {
const $tab = $(tab);
const $target = $tab.find('[data-drupal-nav-tabs-target]');
......@@ -25,12 +26,10 @@
*/
Drupal.behaviors.navTabs = {
attach(context) {
$(context)
.find('[data-drupal-nav-tabs].is-collapsible')
.once('nav-tabs')
$(once('nav-tabs', '[data-drupal-nav-tabs].is-collapsible', context))
.each((i, value) => {
$(value).each(init);
});
},
};
})(jQuery, Drupal);
})(jQuery, Drupal, once);
......@@ -5,7 +5,7 @@
* @preserve
**/
(function ($, Drupal) {
(function ($, Drupal, once) {
function init(i, tab) {
var $tab = $(tab);
var $target = $tab.find('[data-drupal-nav-tabs-target]');
......@@ -23,9 +23,9 @@
Drupal.behaviors.navTabs = {
attach: function attach(context) {
$(context).find('[data-drupal-nav-tabs].is-collapsible').once('nav-tabs').each(function (i, value) {
$(once('nav-tabs', '[data-drupal-nav-tabs].is-collapsible', context)).each(function (i, value) {
$(value).each(init);
});
}
};
})(jQuery, Drupal);
\ No newline at end of file
})(jQuery, Drupal, once);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment