Show More
@@ -83,17 +83,20 | |||
|
83 | 83 | console.error("View creation failed", model); |
|
84 | 84 | } |
|
85 | 85 | if (cell.widget_subarea) { |
|
86 | ||
|
87 | 86 | cell.widget_area.show(); |
|
88 | // Have the IPython keyboard manager disable its event | |
|
89 | // handling so the widget can capture keyboard input. | |
|
90 | // Note, this is only done on the outer most widget. | |
|
91 | IPython.keyboard_manager.register_events(view.$el); | |
|
87 | this._handle_display_view(view); | |
|
92 | 88 | cell.widget_subarea.append(view.$el); |
|
93 | 89 | } |
|
94 | 90 | } |
|
95 | 91 | }; |
|
96 | 92 | |
|
93 | WidgetManager.prototype._handle_display_view = function (view) { | |
|
94 | // Have the IPython keyboard manager disable its event | |
|
95 | // handling so the widget can capture keyboard input. | |
|
96 | // Note, this is only done on the outer most widget. | |
|
97 | IPython.keyboard_manager.register_events(view.$el); | |
|
98 | }; | |
|
99 | ||
|
97 | 100 | WidgetManager.prototype.create_view = function(model, options, view) { |
|
98 | 101 | // Creates a view for a particular model. |
|
99 | 102 | var view_name = model.get('_view_name'); |
@@ -113,17 +116,11 | |||
|
113 | 116 | view.render(); |
|
114 | 117 | model.views.push(view); |
|
115 | 118 | model.on('destroy', view.remove, view); |
|
116 | ||
|
117 | this._handle_new_view(view); | |
|
118 | 119 | return view; |
|
119 | 120 | } |
|
120 | 121 | return null; |
|
121 | 122 | }; |
|
122 | 123 | |
|
123 | WidgetManager.prototype._handle_new_view = function (view) { | |
|
124 | // Called when a view has been created and rendered. | |
|
125 | }; | |
|
126 | ||
|
127 | 124 | WidgetManager.prototype.get_msg_cell = function (msg_id) { |
|
128 | 125 | var cell = null; |
|
129 | 126 | // First, check to see if the msg was triggered by cell execution. |
General Comments 0
You need to be logged in to leave comments.
Login now