@financial-times/o-tracking
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -7,3 +7,4 @@ import Delegate from "ftdomdelegate"; | ||
import { getTrace } from "../../libs/get-trace.js"; | ||
var internalQueue; // Trigger the event tracking | ||
var internalQueue; | ||
var delegate; // Trigger the event tracking | ||
@@ -111,6 +112,6 @@ var track = eventData => { | ||
var delegate = new Delegate(document.body); | ||
delegate = delegate || new Delegate(document.body); | ||
delegate.on('click', elementsToTrack, handleClickEvent(eventData), true); // Track any queued events | ||
internalQueue = new Queue('clicks'); | ||
internalQueue = internalQueue || new Queue('clicks'); | ||
runQueue(); // Listen for page requests. If this is a single page app, we can send link requests now. | ||
@@ -117,0 +118,0 @@ |
@@ -167,3 +167,3 @@ /** | ||
function onPage(cb) { | ||
if (is(cb, 'function')) { | ||
if (is(cb, 'function') && !page_callbacks.includes(cb)) { | ||
page_callbacks.push(cb); | ||
@@ -170,0 +170,0 @@ } |
@@ -22,3 +22,4 @@ "use strict"; | ||
var internalQueue; // Trigger the event tracking | ||
var internalQueue; | ||
var delegate; // Trigger the event tracking | ||
@@ -126,6 +127,6 @@ var track = eventData => { | ||
var delegate = new _ftdomdelegate.default(document.body); | ||
delegate = delegate || new _ftdomdelegate.default(document.body); | ||
delegate.on('click', elementsToTrack, handleClickEvent(eventData), true); // Track any queued events | ||
internalQueue = new _queue.Queue('clicks'); | ||
internalQueue = internalQueue || new _queue.Queue('clicks'); | ||
runQueue(); // Listen for page requests. If this is a single page app, we can send link requests now. | ||
@@ -132,0 +133,0 @@ |
@@ -197,3 +197,3 @@ "use strict"; | ||
function onPage(cb) { | ||
if (is(cb, 'function')) { | ||
if (is(cb, 'function') && !page_callbacks.includes(cb)) { | ||
page_callbacks.push(cb); | ||
@@ -200,0 +200,0 @@ } |
@@ -16,3 +16,3 @@ { | ||
"name": "@financial-times/o-tracking", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Origami module for FT tracking.", | ||
@@ -19,0 +19,0 @@ "dependencies": { |
@@ -9,2 +9,3 @@ import Delegate from 'ftdomdelegate'; | ||
let internalQueue; | ||
let delegate; | ||
@@ -110,7 +111,7 @@ // Trigger the event tracking | ||
// Activate the click event listener | ||
const delegate = new Delegate(document.body); | ||
delegate = delegate || new Delegate(document.body); | ||
delegate.on('click', elementsToTrack, handleClickEvent(eventData), true); | ||
// Track any queued events | ||
internalQueue = new Queue('clicks'); | ||
internalQueue = internalQueue || new Queue('clicks'); | ||
runQueue(); | ||
@@ -117,0 +118,0 @@ |
@@ -153,3 +153,3 @@ /** | ||
function onPage(cb) { | ||
if (is(cb, 'function')) { | ||
if (is(cb, 'function') && !page_callbacks.includes(cb)) { | ||
page_callbacks.push(cb); | ||
@@ -156,0 +156,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
337493
8254
0