Show More
@@ -93,8 +93,14 | |||||
93 | WidgetManager.prototype._handle_display_view = function (view) { |
|
93 | WidgetManager.prototype._handle_display_view = function (view) { | |
94 | // Have the IPython keyboard manager disable its event |
|
94 | // Have the IPython keyboard manager disable its event | |
95 | // handling so the widget can capture keyboard input. |
|
95 | // handling so the widget can capture keyboard input. | |
96 | // Note, this is only done on the outer most widget. |
|
96 | // Note, this is only done on the outer most widgets. | |
|
97 | if (view.elements) { | |||
|
98 | for (var i = 0; i < view.elements.length; i++) { | |||
|
99 | IPython.keyboard_manager.register_events(view.elements[i]); | |||
|
100 | } | |||
|
101 | } else { | |||
97 | IPython.keyboard_manager.register_events(view.$el); |
|
102 | IPython.keyboard_manager.register_events(view.$el); | |
|
103 | } | |||
98 | }; |
|
104 | }; | |
99 |
|
105 | |||
100 | WidgetManager.prototype.create_view = function(model, options, view) { |
|
106 | WidgetManager.prototype.create_view = function(model, options, view) { |
@@ -75,6 +75,14 define(["notebook/js/widgets/widget"], function(WidgetManager) { | |||||
75 | .mousedown(function(){ |
|
75 | .mousedown(function(){ | |
76 | that.bring_to_front(); |
|
76 | that.bring_to_front(); | |
77 | }); |
|
77 | }); | |
|
78 | ||||
|
79 | // Set the elements array since the this.$window element is not child | |||
|
80 | // of this.$el and the parent widget manager or other widgets may | |||
|
81 | // need to know about all of the top-level widgets. The IPython | |||
|
82 | // widget manager uses this to register the elements with the | |||
|
83 | // keyboard manager. | |||
|
84 | this.elements = [this.$el, this.$window] | |||
|
85 | ||||
78 | this.$title_bar = $('<div />') |
|
86 | this.$title_bar = $('<div />') | |
79 | .addClass('popover-title') |
|
87 | .addClass('popover-title') | |
80 | .appendTo(this.$window) |
|
88 | .appendTo(this.$window) |
General Comments 0
You need to be logged in to leave comments.
Login now