Minor documentation change to `PageTracker`
This commit is contained in:
parent
5fc150e057
commit
1cda92c753
|
@ -1,18 +1,14 @@
|
||||||
/**
|
/**
|
||||||
Called whenever the "page" changes. This allows us to set up analytics
|
Called whenever the "page" changes. This allows us to set up analytics
|
||||||
and other tracking.
|
and other tracking.
|
||||||
|
|
||||||
To get notified when the page changes, you can install a hook like so:
|
To get notified when the page changes, you can install a hook like so:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
Discourse.PageTracker.current().on('change', function(url) {
|
Discourse.PageTracker.current().on('change', function(url, title) {
|
||||||
console.log('the page changed to: ' + url);
|
console.log('the page changed to: ' + url + ' and title ' + title);
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
@class PageTracker
|
|
||||||
@namespace Discourse
|
|
||||||
@module Discourse
|
|
||||||
**/
|
**/
|
||||||
Discourse.PageTracker = Ember.Object.extend(Ember.Evented, {
|
Discourse.PageTracker = Ember.Object.extend(Ember.Evented, {
|
||||||
start: function() {
|
start: function() {
|
||||||
|
|
Loading…
Reference in New Issue