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
app/assets/javascripts/discourse/lib

View File

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