Skip to content

Commit

Permalink
Convert didTransition to routeDidChange
Browse files Browse the repository at this point in the history
  • Loading branch information
backspace committed Dec 10, 2018
1 parent 40bf52a commit 7b90f24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 0 additions & 8 deletions app/router.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
/* global _gaq */
import EmberRouter from '@ember/routing/router';
import config from './config/environment';

const Router = EmberRouter.extend({
location: config.locationType,
rootURL: config.rootURL,

didTransition() {
this._super(...arguments);
if (config.gaCode) {
_gaq.push(['_trackPageview', location.pathname]);
}
}
});

Router.map(function () {
Expand Down
9 changes: 8 additions & 1 deletion app/routes/application.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global Travis */
/* global Travis, _gaq */
import $ from 'jquery';

import TravisRoute from 'travis/routes/basic';
Expand All @@ -22,6 +22,13 @@ export default TravisRoute.extend(BuildFaviconMixin, KeyboardShortcuts, {
this.get('auth').afterSignOut(() => {
this.afterSignOut();
});

this.router.on('routeDidChange', () => {
if (config.gaCode) {
_gaq.push(['_trackPageview', location.pathname]);
}
});

return this._super(...arguments);
},

Expand Down

0 comments on commit 7b90f24

Please sign in to comment.