mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Unconditionally register $el with keyboard manager
also s/elements/additional_elements
This commit is contained in:
parent
ef2c71c34d
commit
4a314ea3da
@ -94,13 +94,13 @@
|
||||
// Have the IPython keyboard manager disable its event
|
||||
// handling so the widget can capture keyboard input.
|
||||
// Note, this is only done on the outer most widgets.
|
||||
if (view.elements) {
|
||||
for (var i = 0; i < view.elements.length; i++) {
|
||||
IPython.keyboard_manager.register_events(view.elements[i]);
|
||||
IPython.keyboard_manager.register_events(view.$el);
|
||||
|
||||
if (view.additional_elements) {
|
||||
for (var i = 0; i < view.additional_elements.length; i++) {
|
||||
IPython.keyboard_manager.register_events(view.additional_elements[i]);
|
||||
}
|
||||
} else {
|
||||
IPython.keyboard_manager.register_events(view.$el);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
WidgetManager.prototype.create_view = function(model, options, view) {
|
||||
|
@ -81,7 +81,7 @@ define(["notebook/js/widgets/widget"], function(WidgetManager) {
|
||||
// need to know about all of the top-level widgets. The IPython
|
||||
// widget manager uses this to register the elements with the
|
||||
// keyboard manager.
|
||||
this.elements = [this.$el, this.$window]
|
||||
this.additional_elements = [this.$window]
|
||||
|
||||
this.$title_bar = $('<div />')
|
||||
.addClass('popover-title')
|
||||
|
Loading…
Reference in New Issue
Block a user