Skip to content

Commit

Permalink
Merge pull request #7 from OpenBuildings/table-checkbox-improvement
Browse files Browse the repository at this point in the history
Improve checkbox selecting in tables
  • Loading branch information
ivank committed Feb 18, 2014
2 parents 9f9ec07 + 9ee49f0 commit 19ef639
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web/js/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ $(function(){
});
});

$('body').on('click', 'td', function(e){
$('body').on('click', 'td', function(e) {
e.stopPropagation();
if (e.target && ['a', 'button', 'input', 'select', 'textarea', 'label'].indexOf(e.target.nodeName.toLowerCase()) === -1)
{
$(this).closest('tr').first('td').find('input[type="checkbox"]').each(function(){
$(this).closest('tr').children('td:first').find('input[type="checkbox"]').each(function(){
$(this).click();
});
}
Expand Down Expand Up @@ -121,4 +122,4 @@ $(function(){
}
}, this), 0);
});
});
});

0 comments on commit 19ef639

Please sign in to comment.