Removing _trackEvent method

It has become an unnecessary abstraction around _gaq.push
This commit is contained in:
Jeff Avallone
2015-01-01 11:56:36 -05:00
parent fd8014d326
commit 37fca15bc8
2 changed files with 12 additions and 29 deletions
+7 -11
View File
@@ -72,10 +72,6 @@ export default class Regexper {
return decodeURIComponent(location.hash.slice(1));
}
_trackEvent(category, action) {
window._gaq.push(['_trackEvent', category, action]);
}
set state(state) {
this.root.className = state;
}
@@ -144,7 +140,7 @@ export default class Regexper {
}
this.state = 'is-loading';
this._trackEvent('visualization', 'start');
window._gaq.push(['_trackEvent', 'visualization', 'start']);
this.running = new Parser(this.svgContainer);
@@ -161,17 +157,17 @@ export default class Regexper {
})
.invoke('render')
.then(() => {
this.state = 'has-results';
this.updateLinks();
this.displayWarnings(this.running.warnings);
this._trackEvent('visualization', 'complete');
this.state = 'has-results';
this.updateLinks();
this.displayWarnings(this.running.warnings);
window._gaq.push(['_trackEvent', 'visualization', 'complete']);
})
.then(null, message => {
if (message === 'Render cancelled') {
this._trackEvent('visualization', 'cancelled');
window._gaq.push(['_trackEvent', 'visualization', 'cancelled']);
this.state = '';
} else if (parseError) {
this._trackEvent('visualization', 'parse error');
window._gaq.push(['_trackEvent', 'visualization', 'parse error']);
} else {
throw message;
}