1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00

Added active navigation state for all integrations related routes (#1069)

closes https://github.com/TryGhost/Ghost/issues/10136
- use a CP and `{{#link-to current-when}}` to add the `.active` class any time the current route name starts with `settings.integration` which covers built-in and custom integration screens
This commit is contained in:
Rishabh Garg 2018-11-12 18:40:33 +05:30 committed by Kevin Ansfield
parent 2079204d4b
commit 1af437a92e
2 changed files with 6 additions and 1 deletions

View file

@ -31,6 +31,11 @@ export default Component.extend({
return this.get('config.clientExtensions.script') && this.get('session.user.isOwner');
}),
isIntegrationRoute: computed('router.currentRouteName', function () {
let re = /^settings\.integration/;
return re.test(this.router.currentRouteName);
}),
// the menu has a rendering issue (#8307) when the the world is reloaded
// during an import which we have worked around by not binding the icon
// style directly. However we still need to keep track of changing icons

View file

@ -64,7 +64,7 @@
<li>{{#link-to "settings.design" data-test-nav="design"}}{{svg-jar "compass"}}Design{{/link-to}}</li>
<li>{{#link-to "settings.tags" data-test-nav="tags"}}{{svg-jar "tag"}}Tags{{/link-to}}</li>
<li>{{#link-to "settings.code-injection" data-test-nav="code-injection"}}{{svg-jar "brackets"}}Code injection{{/link-to}}</li>
<li>{{#link-to "settings.integrations" data-test-nav="integrations"}}{{svg-jar "box"}}Integrations{{/link-to}}</li>
<li>{{#link-to "settings.integrations" current-when=isIntegrationRoute data-test-nav="integrations"}}{{svg-jar "box"}}Integrations{{/link-to}}</li>
<li>{{#link-to "settings.labs" data-test-nav="labs"}}{{svg-jar "wrench-double"}}Labs{{/link-to}}</li>
</ul>
{{/if}}