Skip to content

Commit

Permalink
Remove jQuery from details component
Browse files Browse the repository at this point in the history
 - Replaced `click()` with `addEventListener()`
 - No change to tests required
  • Loading branch information
injms committed Jul 8, 2020
1 parent 206cde7 commit 40f2194
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
var detailsClick = detailsComponent.querySelector('[data-details-track-click]')
var that = this

$(detailsClick).click(function (e) {
detailsClick.addEventListener('click', function (event) {
that.trackDefault(detailsComponent)
})
}
Expand All @@ -37,7 +37,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
trackOptions = {}
}

trackOptions['label'] = componentStatus
trackOptions.label = componentStatus

if (trackAction && trackCategory) {
window.GOVUK.analytics.trackEvent(trackCategory, trackAction, trackOptions)
Expand Down

0 comments on commit 40f2194

Please sign in to comment.