Skip to content

Commit

Permalink
fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
MattBudz committed Jun 26, 2024
1 parent 4bff9da commit 64652f9
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions app/assets/javascripts/shared/behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,11 @@
}

// Update address bar with current tab param
$(parentElement)
.find('[data-bs-toggle~=tab]')
.on('shown.bs.tab', function (e) {
let currentTab = $(e.target).attr('href').substring(1);
searchParams.set('tab', currentTab);
let urlWithTab = `?${searchParams.toString()}`;
history.pushState(
{ turbolinks: true, url: urlWithTab },
'',
urlWithTab
);
});
$('[data-bs-toggle~=tab]').on('shown.bs.tab', function (e) {
let currentTab = $(e.target).attr('href').substring(1);
searchParams.set('tab', currentTab);
history.pushState(null, null, `?${searchParams.toString()}`);
});
}

document.addEventListener('turbolinks:load', function () {
Expand Down

0 comments on commit 64652f9

Please sign in to comment.