Merge branch '2.1.x' of dev.sourcefabric.org:airtime into 2.1.x

This commit is contained in:
Martin Konecny 2012-06-28 12:12:34 -04:00
commit 1c80cca8ad
1 changed files with 19 additions and 7 deletions

View File

@ -202,13 +202,19 @@ var AIRTIME = (function(AIRTIME) {
*/
mod.selectCurrentPage = function() {
$.fn.reverse = [].reverse;
var $trs = $libTable.find("tbody input:checkbox").parents("tr").reverse();
var $inputs = $libTable.find("tbody input:checkbox"),
$trs = $inputs.parents("tr").reverse();
$inputs.attr("checked", true);
$trs.addClass(LIB_SELECTED_CLASS);
$trs.each(function(i, el){
$el = $(this);
mod.selectItem($el);
mod.addToChosen($el);
});
mod.checkToolBarIcons();
};
/*
@ -216,14 +222,20 @@ var AIRTIME = (function(AIRTIME) {
* (behaviour taken from gmail)
*/
mod.deselectCurrentPage = function() {
var $inputs = $libTable.find("tbody input:checkbox"),
$trs = $inputs.parents("tr"),
id;
var $trs = $libTable.find("tbody input:checkbox").filter(":checked").parents("tr");
$inputs.attr("checked", false);
$trs.removeClass(LIB_SELECTED_CLASS);
$trs.each(function(i, el){
$el = $(this);
mod.deselectItem($el);
});
id = $el.attr("id");
delete chosenItems[id];
});
mod.checkToolBarIcons();
};
mod.selectNone = function() {