Content Server: Fi usage of jQuery pseudo selectors

This commit is contained in:
Kovid Goyal 2009-12-02 01:50:40 +00:00
parent 92f72c027a
commit 7cefca28fe

View File

@ -148,13 +148,13 @@ function fetch_library_books(start, num, timeout, sort, order, search) {
$("#book_list tbody").html(display); $("#book_list tbody").html(display);
$("#book_list tbody tr").bind('mouseenter', function() { $("#book_list tbody tr").bind('mouseenter', function() {
var row = $(this); var row = $(this);
$('#book_list tbody tr:even()').css('background-color', '#eeeeee'); $('#book_list tbody tr:even').css('background-color', '#eeeeee');
$('#book_list tbody tr:odd()').css('background-color', 'white'); $('#book_list tbody tr:odd').css('background-color', 'white');
row.css('background-color', "#fff2a8"); row.css('background-color', "#fff2a8");
row.bind('mouseleave', function(){ row.bind('mouseleave', function(){
row.css('background-color', "white"); row.css('background-color', "white");
$('#book_list tbody tr:even()').css('background-color', '#eeeeee'); $('#book_list tbody tr:even').css('background-color', '#eeeeee');
row.unbind('mouseleave'); row.unbind('mouseleave');
}); });
}); });
@ -173,7 +173,7 @@ function fetch_library_books(start, num, timeout, sort, order, search) {
layout(); layout();
$('#book_list tbody tr:even()').css('background-color', '#eeeeee'); $('#book_list tbody tr:even').css('background-color', '#eeeeee');
}, },
complete : function(XMLHttpRequest, textStatus) { complete : function(XMLHttpRequest, textStatus) {
@ -262,6 +262,7 @@ function setup_sorting() {
if (sort_indicator.html() == '↑') { if (sort_indicator.html() == '↑') {
order = 'descending'; html = '↓'; order = 'descending'; html = '↓';
} }
sort_indicator.html(html); sort_indicator.html(html);
$('#book_list * .sort_indicator').css('visibility', 'hidden'); $('#book_list * .sort_indicator').css('visibility', 'hidden');
sort_indicator.css('visibility', 'visible'); sort_indicator.css('visibility', 'visible');