Show More
@@ -83,17 +83,20 | |||||
83 | console.error("View creation failed", model); |
|
83 | console.error("View creation failed", model); | |
84 | } |
|
84 | } | |
85 | if (cell.widget_subarea) { |
|
85 | if (cell.widget_subarea) { | |
86 |
|
||||
87 | cell.widget_area.show(); |
|
86 | cell.widget_area.show(); | |
88 | // Have the IPython keyboard manager disable its event |
|
87 | this._handle_display_view(view); | |
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); |
|
|||
92 | cell.widget_subarea.append(view.$el); |
|
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 | WidgetManager.prototype.create_view = function(model, options, view) { |
|
100 | WidgetManager.prototype.create_view = function(model, options, view) { | |
98 | // Creates a view for a particular model. |
|
101 | // Creates a view for a particular model. | |
99 | var view_name = model.get('_view_name'); |
|
102 | var view_name = model.get('_view_name'); | |
@@ -113,17 +116,11 | |||||
113 | view.render(); |
|
116 | view.render(); | |
114 | model.views.push(view); |
|
117 | model.views.push(view); | |
115 | model.on('destroy', view.remove, view); |
|
118 | model.on('destroy', view.remove, view); | |
116 |
|
||||
117 | this._handle_new_view(view); |
|
|||
118 | return view; |
|
119 | return view; | |
119 | } |
|
120 | } | |
120 | return null; |
|
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 | WidgetManager.prototype.get_msg_cell = function (msg_id) { |
|
124 | WidgetManager.prototype.get_msg_cell = function (msg_id) { | |
128 | var cell = null; |
|
125 | var cell = null; | |
129 | // First, check to see if the msg was triggered by cell execution. |
|
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