Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

recent_topics: Don't revive focus when user is trying to type.

Aman Agrawala210ee2b7d84
diff --git a/static/js/recent_topics.js b/static/js/recent_topics.js
index 848bbefd1a8..c87d0d13aec 100644
--- a/static/js/recent_topics.js
+++ b/static/js/recent_topics.js
@@ -78,6 +78,12 @@ function revive_current_focus() {
// After re-render, the current_focus_elem is no longer linked
// to the focused element, this function attempts to revive the
// link and focus to the element prior to the rerender.
+
+ // Don't change focus if user is trying to type anywhere.
+ if ($(".home-page-input").is(":focus")) {
+ return false;
+ }
+
if (!current_focus_elem) {
set_default_focus();
return false;
diff --git a/templates/zerver/app/left_sidebar.html b/templates/zerver/app/left_sidebar.html
index f535ce50cb9..ef55ff9ef09 100644
--- a/templates/zerver/app/left_sidebar.html
+++ b/templates/zerver/app/left_sidebar.html
@@ -71,7 +71,7 @@
<i id="streams_inline_cog" class='fa fa-cog' aria-hidden="true" data-toggle="tooltip" data-placement="bottom" title="{{ _('Subscribe, add, or configure streams') }}"></i>
<i id="streams_filter_icon" class='fa fa-search' aria-hidden="true" data-toggle="tooltip" title="{{ _('Filter streams') }} (q)"></i>
<div class="input-append notdisplayed stream_search_section">
- <input class="stream-list-filter" type="text" autocomplete="off" placeholder="{{ _('Search streams') }}" />
+ <input class="stream-list-filter home-page-input" type="text" autocomplete="off" placeholder="{{ _('Search streams') }}" />
<button type="button" class="btn clear_search_button" id="clear_search_stream_button">
<i class="fa fa-remove" aria-hidden="true"></i>
</button>
diff --git a/templates/zerver/app/navbar.html b/templates/zerver/app/navbar.html
index 9a64fed6124..74a1bd58d4c 100644
--- a/templates/zerver/app/navbar.html
+++ b/templates/zerver/app/navbar.html
@@ -31,7 +31,7 @@
<form id="searchbox_form" class="form-search navbar-search">
<div id="search_arrows" class="input-append">
<span class="search_icon search_open" ><i class="fa fa-search" aria-hidden="true"></i></span>
- <input class="search-query input-block-level" id="search_query" type="text" placeholder="{{ _('Search') }}"
+ <input class="search-query input-block-level home-page-input" id="search_query" type="text" placeholder="{{ _('Search') }}"
autocomplete="off" aria-label="{{ _('Search') }}" title="{{ _('Search') }} (/)"/>
<button class="btn search_button" type="button" id="search_exit" aria-label="{{ _('Exit search') }}"><i class="fa fa-remove" aria-hidden="true"></i></button>
</div>
diff --git a/templates/zerver/app/right_sidebar.html b/templates/zerver/app/right_sidebar.html
index 4fbcdd6e11f..34f3e6b5bd9 100644
--- a/templates/zerver/app/right_sidebar.html
+++ b/templates/zerver/app/right_sidebar.html
@@ -6,7 +6,7 @@
<i id="user_filter_icon" class='fa fa-search' aria-hidden="true" aria-label="{{ _('Filter users') }}" data-toggle="tooltip" title="{{ _('Filter users') }} (w)"></i>
</div>
<div class="input-append notdisplayed" id="user_search_section">
- <input class="user-list-filter" type="text" autocomplete="off" placeholder="{{ _('Search people') }}" />
+ <input class="user-list-filter home-page-input" type="text" autocomplete="off" placeholder="{{ _('Search people') }}" />
<button type="button" class="btn clear_search_button" id="clear_search_people_button">
<i class="fa fa-remove" aria-hidden="true"></i>
</button>