Backwards compatibility for people who use `Discourse.PageTracker`

Rather than importing it.
This commit is contained in:
Robin Ward 2016-02-24 11:06:49 -05:00
parent 015eb47ea0
commit 5c3d14b421
1 changed files with 4 additions and 1 deletions

View File

@ -23,9 +23,12 @@ export function onPageChange(fn) {
}
// backwards compatibility
export default {
const BackwardsCompat = {
current() {
console.warn(`Using PageTracker.current() is deprecated. Your plugin should use the PluginAPI`);
return _pageTracker;
}
};
Discourse.PageTracker = BackwardsCompat;
export default BackwardsCompat;