From 5c3d14b42136e51afa00c8f3d992bae4a9b39210 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 24 Feb 2016 11:06:49 -0500 Subject: [PATCH] Backwards compatibility for people who use `Discourse.PageTracker` Rather than importing it. --- app/assets/javascripts/discourse/lib/page-tracker.js.es6 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/page-tracker.js.es6 b/app/assets/javascripts/discourse/lib/page-tracker.js.es6 index 7ef49363b9d..7e63b5c7311 100644 --- a/app/assets/javascripts/discourse/lib/page-tracker.js.es6 +++ b/app/assets/javascripts/discourse/lib/page-tracker.js.es6 @@ -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;