narrow: Fix narrowing errors for topics with name 'home'.

Added a `.home-link` class to 'Home' links to separate them
from topic links with the name 'home'

Fixes #3340
This commit is contained in:
Sampriti Panda
2017-01-16 21:13:02 +05:30
committed by showell
parent 7b5bc40b42
commit b4b6516ca0
3 changed files with 3 additions and 3 deletions

View File

@@ -264,7 +264,7 @@ $(function () {
// HOME
// Capture both the left-sidebar Home click and the tab breadcrumb Home
$(document).on('click', "li[data-name='home']", function (e) {
$(document).on('click', ".home-link[data-name='home']", function (e) {
ui.change_tab_to('#home');
narrow.deactivate();
// We need to maybe scroll to the selected message

View File

@@ -1,6 +1,6 @@
<ul id="tab_list">
{{#each tabs}}
<li class="{{active}} {{cls}}" {{#if data}}data-name="{{data}}"{{/if}}>
<li class="{{active}} {{cls}} {{#if home}}home-link{{/if}}" {{#if data}}data-name="{{data}}"{{/if}}>
{{#if icon}}
<i class="icon-vector-narrow icon-vector-small"></i>
{{/if}}

View File

@@ -3,7 +3,7 @@
<ul id="global_filters" class="filters">
{# Special-case this link so we don't actually go to page top. #}
<li data-name="home"
class="global-filter active-filter"><span class="filter-icon"><i class="icon-vector-home"></i></span><a href="#">{{ _('Home') }} <span class="count"><span class="value"></span></span></a></li>
class="global-filter active-filter home-link"><span class="filter-icon"><i class="icon-vector-home"></i></span><a href="#">{{ _('Home') }} <span class="count"><span class="value"></span></span></a></li>
<li data-name="private" class="global-filter"><span class="filter-icon"><i class="icon-vector-envelope"></i></span><a href="#narrow/is/private">{{ _('Private messages') }} <span class="count"><span class="value"></span></span></a></li>
<li data-name="starred" class="global-filter"><span class="filter-icon"><i class="icon-vector-star"></i></span><a href="#narrow/is/starred">{{ _('Starred messages') }}</a></li>
<li data-name="mentioned" class="global-filter"><span class="filter-icon"><i class="icon-vector-tag"></i></span><a href="#narrow/is/mentioned">{{ _('@-mentions') }}<span class="count"><span class="value"></span></span></a></li>