Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix command mode & popup view bug #5014

Merged
merged 2 commits into from Feb 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion IPython/html/static/notebook/js/widgetmanager.js
Expand Up @@ -93,8 +93,14 @@
WidgetManager.prototype._handle_display_view = function (view) {
// 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 widget.
// Note, this is only done on the outer most widgets.
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]);
}
}
};

WidgetManager.prototype.create_view = function(model, options, view) {
Expand Down
8 changes: 8 additions & 0 deletions IPython/html/static/notebook/js/widgets/widget_container.js
Expand Up @@ -75,6 +75,14 @@ define(["notebook/js/widgets/widget"], function(WidgetManager) {
.mousedown(function(){
that.bring_to_front();
});

// Set the elements array since the this.$window element is not child
// of this.$el and the parent widget manager or other widgets may
// 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.additional_elements = [this.$window]

this.$title_bar = $('<div />')
.addClass('popover-title')
.appendTo(this.$window)
Expand Down