Content link resets filter if already viewing content screen (#521)

no issue

- the content filter will be remembered if you navigate away from then back to the content screen
- this PR changes the behaviour slightly so that clicking the sidebar "Content" link whilst viewing the content screen will act as a shortcut to reset the filter
This commit is contained in:
Kevin Ansfield 2017-02-10 13:24:13 +00:00 committed by Katharina Irrgang
parent bb007ec84f
commit a8a7e98150
2 changed files with 9 additions and 1 deletions

View File

@ -20,6 +20,7 @@ export default Component.extend({
session: injectService(),
ghostPaths: injectService(),
feature: injectService(),
routing: injectService('-routing'),
mouseEnter() {
this.sendAction('onMouseEnter');

View File

@ -21,8 +21,15 @@
<ul class="gh-nav-list gh-nav-main">
{{!<li><i class="icon-dash"></i>Dashboard</li>}}
<li>{{#link-to "editor.new" classNames="gh-nav-main-editor"}}<i class="icon-pen"></i>New Post{{/link-to}}</li>
<li>{{#link-to "posts" classNames="gh-nav-main-content"}}<i class="icon-content"></i>Content{{/link-to}}</li>
{{!<li><a href="#"><i class="icon-user"></i>My Posts</a></li>}}
<li>
{{!-- clicking the Content link whilst on the content screen should reset the filter --}}
{{#if (eq routing.currentRouteName "posts.index")}}
{{#link-to "posts" (query-params type=null) classNames="gh-nav-main-content active"}}<i class="icon-content"></i>Content{{/link-to}}
{{else}}
{{#link-to "posts" classNames="gh-nav-main-content"}}<i class="icon-content"></i>Content{{/link-to}}
{{/if}}
</li>
<li>{{#link-to "team" classNames="gh-nav-main-users"}}<i class="icon-team"></i>Team{{/link-to}}</li>
{{!<li><a href="#"><i class="icon-idea"></i>Ideas</a></li>}}
{{#if feature.subscribers}}