Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
Merge pull request #745 from jmancewicz/deselect-with-click-outside
Browse files Browse the repository at this point in the history
Deselect with click outside the tables
  • Loading branch information
lukeyeager committed May 16, 2016
2 parents 7eab572 + 1798d59 commit f8c87de
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions digits/static/js/table_selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ function TableSelection(table_id) {
e.stopPropagation();
});

// deselect when the mouse is cli
$(document).on('click', 'body', function(e) {
var tag = e.target.tagName.toLowerCase();
if (tag == 'input' || tag == 'textarea' || tag == 'button' || tag == 'a') {
return;
}

if (TableSelection.current_table == null) {
deselect($('tr'));
}
});

// Let links continue to work. Without this, a click would
// only do a row selection.
Expand Down

0 comments on commit f8c87de

Please sign in to comment.