CC-1977: Allow multiple files to be selected and acted upon in the library and playlist

Fixed the bug where checkbox change events get handled multiple times
This commit is contained in:
Yuchen Wang 2012-01-11 15:36:45 -05:00
parent cf045652ec
commit 09df61d027
1 changed files with 5 additions and 9 deletions

View File

@ -405,9 +405,6 @@ function toggleAll() {
}
$(this).addClass('selected');
} else {
if (type == "pl") {
checkedPLCount--;
}
$(this).removeClass('selected');
}
});
@ -428,7 +425,7 @@ function enableGroupBtn(btnId, func) {
btnId = '#' + btnId;
if ($(btnId).hasClass('ui-state-disabled')) {
$(btnId).removeClass('ui-state-disabled');
$(btnId).click(func);
$(btnId).unbind("click").click(func);
}
}
@ -476,16 +473,15 @@ function checkBoxChanged() {
} else if (!cbAllChecked && checkedCount == size) {
cbAll.attr("checked", true);
}
}
function setupGroupActions() {
checkedCount = 0;
checkedPLCount = 0;
$('#library_display tr:nth-child(1)').find(":checkbox").attr("checked", false);
$('#library_display thead').find(":checkbox").change(toggleAll);
$('#library_display thead').find(":checkbox").unbind('change').change(toggleAll);
$('#library_display tbody tr').each(function() {
$(this).find(":checkbox").change(checkBoxChanged);
$(this).find(":checkbox").unbind('change').change(checkBoxChanged);
});
disableGroupBtn('library_group_add');
@ -567,7 +563,7 @@ function createDataTable(data) {
$(document).ready(function() {
$('.tabs').tabs();
$.ajax({ url: "/Api/library-init/format/json", dataType:"json", success:createDataTable,
$.ajax({url: "/Api/library-init/format/json", dataType:"json", success:createDataTable,
error:function(jqXHR, textStatus, errorThrown){}});
checkImportStatus();