Fix #110 : make user management table sortable

This commit is contained in:
Romain Neutron
2011-12-26 17:24:50 +01:00
parent 206bf058d5
commit 9f8dd943b3
4 changed files with 98 additions and 11 deletions

View File

@@ -18,6 +18,29 @@ $(document).ready(function(){
$(n).addClass('selected');
return true;
}
$('#users th.sortable').live('click', function(){
var $this = $(this);
var sort = $('input', $this).val();
if((sort == $('#users_page_form input[name="srt"]').val())
&& ($('#users_page_form input[name="ord"]').val() == 'asc'))
{
var ord = 'desc';
}
else
{
var ord = 'asc';
}
$('#users_page_form input[name="srt"]').val(sort);
$('#users_page_form input[name="ord"]').val(ord);
$('#users_page_form').trigger('submit');
}).live('mouseover', function(){$(this).addClass('hover');})
.live('mouseout', function(){$(this).removeClass('hover');});
var buttons = {};
buttons[language.create_user] = function(){