Fixed clickable rows while upload is ongoing

This commit is contained in:
Marcin Kurczewski 2014-09-20 09:13:21 +02:00
parent 8e6d7af3ea
commit a3fbe80281
2 changed files with 11 additions and 1 deletions

1
TODO
View file

@ -3,7 +3,6 @@ first major release.
everything related to posts: everything related to posts:
- uploads - uploads
- user shouldn't be able click form rows when upload is active
- fix thumbnails for files that are neither youtube or images - fix thumbnails for files that are neither youtube or images
- post list - post list

View file

@ -197,6 +197,9 @@ App.Presenters.PostUploadPresenter = function(
function postTableRowClicked(e) { function postTableRowClicked(e) {
e.preventDefault(); e.preventDefault();
if (!interactionEnabled) {
return;
}
var $allCheckboxes = jQuery(this).parents('table').find('tbody input[type=checkbox]'); var $allCheckboxes = jQuery(this).parents('table').find('tbody input[type=checkbox]');
var $myCheckbox = jQuery(this).parents('tr').find('input[type=checkbox]'); var $myCheckbox = jQuery(this).parents('tr').find('input[type=checkbox]');
$allCheckboxes.prop('checked', false); $allCheckboxes.prop('checked', false);
@ -205,6 +208,10 @@ App.Presenters.PostUploadPresenter = function(
} }
function postTableCheckboxClicked(e) { function postTableCheckboxClicked(e) {
if (!interactionEnabled) {
e.preventDefault();
return;
}
if (e.target.nodeName === 'TD') { if (e.target.nodeName === 'TD') {
var checkbox = jQuery(this).find('input[type=checkbox]'); var checkbox = jQuery(this).find('input[type=checkbox]');
checkbox.prop('checked', !checkbox.prop('checked')); checkbox.prop('checked', !checkbox.prop('checked'));
@ -213,6 +220,10 @@ App.Presenters.PostUploadPresenter = function(
} }
function postTableSelectAllCheckboxClicked(e) { function postTableSelectAllCheckboxClicked(e) {
if (!interactionEnabled) {
e.preventDefault();
return;
}
var $checkbox = jQuery(this).find('input[type=checkbox]'); var $checkbox = jQuery(this).find('input[type=checkbox]');
if (e.target.nodeName === 'TH') { if (e.target.nodeName === 'TH') {
$checkbox.prop('checked', !$checkbox.prop('checked')); $checkbox.prop('checked', !$checkbox.prop('checked'));