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:
Waseem Daher
2013-03-06 14:46:33 -05:00
parent a64dd5a712
commit c41fa46fb4
3 changed files with 12 additions and 28 deletions

View File

@@ -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');
}
}