Skip to content

Commit

Permalink
event test
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasnteireho committed Dec 6, 2023
1 parent c3fb1bc commit 62b0a1a
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/mobile/pages/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export default Component.extend({
}
},

fireLearnMoreModal : ViewerStepsVM.fireLearnMoreModal,
events: {
'a click': function (el, ev) {
if (el.href && el.href.toLowerCase().indexOf('popup') === 0) {
Expand Down Expand Up @@ -86,6 +85,32 @@ export default Component.extend({
}
},

'a.learn-more click':fireLearnMoreModal () {
const pages = this.interview.pages
const pageName = this.appState.page

if (pages && pageName) {
const page = pages.find(pageName)

// piwik tracking of learn-more clicks
if (window._paq) {
analytics.trackCustomEvent('Learn-More', 'from: ' + pageName, page.learn)
}

this.appState.modalContent = {
// name undefined prevents stache warnings
title: page.learn,
text: page.help,
imageURL: (page.helpImageURL || '').trim(),
altText: page.helpAltText,
mediaLabel: page.helpMediaLabel,
audioURL: (page.helpAudioURL || '').trim(),
videoURL: (page.helpVideoURL || '').trim(),
helpReader: page.helpReader
}
}
},

'button.open-preview click': function (el, ev) {
ev.preventDefault()

Expand Down

0 comments on commit 62b0a1a

Please sign in to comment.