mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: uses private API for currentPath (#7911)
* DEV: uses with private API for currentPath router.currentRouteName as a slightly different API and application.currentPath is deprecated * another fix
This commit is contained in:
committed by
Robin Ward
parent
e8a14a3a65
commit
8dfd0e0374
@@ -13,7 +13,7 @@ export default Ember.Controller.extend({
|
||||
return this.currentUser.get("admin") && enableBadges;
|
||||
},
|
||||
|
||||
@computed("router.currentRouteName")
|
||||
@computed("router._router.currentPath")
|
||||
adminContentsClassName(currentPath) {
|
||||
let cssClasses = currentPath
|
||||
.split(".")
|
||||
@@ -22,16 +22,15 @@ export default Ember.Controller.extend({
|
||||
segment !== "index" &&
|
||||
segment !== "loading" &&
|
||||
segment !== "show" &&
|
||||
segment !== "admin" &&
|
||||
segment !== "dashboard"
|
||||
segment !== "admin"
|
||||
);
|
||||
})
|
||||
.map(Ember.String.dasherize)
|
||||
.join(" ");
|
||||
|
||||
// this is done to avoid breaking css customizations
|
||||
if (currentPath.indexOf("admin.dashboard") > -1) {
|
||||
cssClasses = `${cssClasses} dashboard dashboard-next`;
|
||||
if (cssClasses.includes("dashboard")) {
|
||||
cssClasses = `${cssClasses} dashboard-next`;
|
||||
}
|
||||
|
||||
return cssClasses;
|
||||
|
||||
Reference in New Issue
Block a user