mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
Fix filter text box bugs reported by BentMyWookie and a bit more cleanup
This commit is contained in:
@@ -47,9 +47,7 @@ $(document).ready( function() {
|
||||
// firefox so have to be safari-specific
|
||||
$('#torrent_inspector').css('height', '100%');
|
||||
|
||||
// Set Filter input to type search (nicely styled input field)
|
||||
$('#torrent_search')[0].type = 'search';
|
||||
$('#torrent_search')[0].placeholder = 'Filter';
|
||||
// Move search field's margin down for the styled input
|
||||
$('#torrent_search').css('margin-top', 3);
|
||||
}
|
||||
if (!Safari3 && !iPhone) {
|
||||
|
||||
@@ -166,21 +166,25 @@ Transmission.prototype =
|
||||
{
|
||||
var tr = this;
|
||||
var search_box = $('#torrent_search');
|
||||
search_box[0].value = 'filter';
|
||||
search_box.bind('keyup', {transmission: this}, function(event) {
|
||||
search_box.bind('keyup click', {transmission: this}, function(event) {
|
||||
tr.setSearch(this.value);
|
||||
}).bind('blur', {transmission: this}, function(event) {
|
||||
if (this.value == '') {
|
||||
$(this).addClass('blur');
|
||||
this.value = 'filter';
|
||||
tr.setSearch(null);
|
||||
}
|
||||
}).bind('focus', {}, function(event) {
|
||||
if ($(this).is('.blur')) {
|
||||
this.value = '';
|
||||
$(this).removeClass('blur');
|
||||
}
|
||||
});
|
||||
if (!$.browser.safari)
|
||||
{
|
||||
search_box[0].value = 'Filter';
|
||||
search_box.bind('blur', {transmission: this}, function(event) {
|
||||
if (this.value == '') {
|
||||
$(this).addClass('blur');
|
||||
this.value = 'Filter';
|
||||
tr.setSearch(null);
|
||||
}
|
||||
}).bind('focus', {}, function(event) {
|
||||
if ($(this).is('.blur')) {
|
||||
this.value = '';
|
||||
$(this).removeClass('blur');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
contextStopSelected: function( ) {
|
||||
|
||||
Reference in New Issue
Block a user