Unconditionally register $el with keyboard manager

also s/elements/additional_elements
This commit is contained in:
Jonathan Frederic 2014-02-04 09:44:38 -08:00
parent ef2c71c34d
commit 4a314ea3da
2 changed files with 7 additions and 7 deletions

View File

@ -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) {

View File

@ -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')