mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
Always show the searchbar 'x'.
This simplifies a bunch of fragile resizing logic in our code, and also addresses the Chrome Canary bug where clicking in the searchbox causes the navbar to get huge. This fixes Trac #764 and Trac #1039 (imported from commit fc8c3995109de384b71dfba2b986a8500ff7f08d)
This commit is contained in:
@@ -149,23 +149,9 @@ function update_buttons_with_focus(focused) {
|
||||
if (focused
|
||||
|| search_query.val()
|
||||
|| narrow.active()) {
|
||||
|
||||
if ($('.search_button').is(':visible')) {
|
||||
// Already visible, and the width manipulation below
|
||||
// will break if we do it again.
|
||||
return;
|
||||
}
|
||||
// Shrink the searchbox to make room for the buttons.
|
||||
var new_width = search_query.width() -
|
||||
$('.search_button').outerWidth(true);
|
||||
search_query.width(new_width-1);
|
||||
$("#search_arrows").addClass("input-append");
|
||||
$('.search_button').show();
|
||||
$('.search_button').removeAttr('disabled');
|
||||
} else {
|
||||
// Hide buttons.
|
||||
$('#search_query').width('');
|
||||
$("#search_arrows").removeClass("input-append");
|
||||
$('.search_button').blur().hide();
|
||||
$('.search_button').attr('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user