mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
don't stop propagation in dashboard
Stopping click propagation should be avoided when used as a hack for something else, as it interacts poorly with the open/close mechanics of Bootstrap menus (amongst others). (more [here](http://css-tricks.com/dangers-stopping-event-propagation/) This code preserves the intended behaviour (toggling the checkbox when clicking on the row, except for the link) without resorting to `stopPropagation()`
This commit is contained in:
parent
2aac3e913a
commit
cbd7f1fc98
@ -336,16 +336,11 @@ define([
|
|||||||
checkbox.css('visibility', 'hidden');
|
checkbox.css('visibility', 'hidden');
|
||||||
} else if (selectable === true) {
|
} else if (selectable === true) {
|
||||||
var that = this;
|
var that = this;
|
||||||
link.click(function(e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
});
|
|
||||||
checkbox.click(function(e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
that._selection_changed();
|
|
||||||
});
|
|
||||||
row.click(function(e) {
|
row.click(function(e) {
|
||||||
e.stopPropagation();
|
// toggle checkbox only if the click doesn't come from the checkbox or the link
|
||||||
|
if (!$(e.target).is('span[class=item_name]') && !$(e.target).is('input[type=checkbox]')) {
|
||||||
checkbox.prop('checked', !checkbox.prop('checked'));
|
checkbox.prop('checked', !checkbox.prop('checked'));
|
||||||
|
}
|
||||||
that._selection_changed();
|
that._selection_changed();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user