Skip to content

Commit

Permalink
add event listener for checkbox alongwith file table row
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekkr12 committed Jul 4, 2016
1 parent 1992040 commit 2dda607
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ Uploader.prototype = {
var selectedRowColor = this.selectedRowColor;
row.insertCell().innerHTML = "<input type='checkbox' class='fileRowCheckBox'>";
row.style.cursor = "pointer";
var checkBox = row.getElementsByClassName('fileRowCheckBox')[0];
row.addEventListener('click', function () {
var checkBox = row.getElementsByClassName('fileRowCheckBox')[0];
if (checkBox.checked) {
checkBox.checked = false;
row.style.backgroundColor = "#ffffff";
Expand All @@ -400,6 +400,17 @@ Uploader.prototype = {
row.style.backgroundColor = selectedRowColor;
}
});

checkBox.addEventListener('click', function () {
if (checkBox.checked) {
checkBox.checked = false;
row.style.backgroundColor = "#ffffff";
} else {
checkBox.checked = true;
row.style.backgroundColor = selectedRowColor;
}
});

var i;
for (i in fileDtls) {
if (fileDtls.hasOwnProperty(i)) {
Expand Down
2 changes: 1 addition & 1 deletion upload.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2dda607

Please sign in to comment.