Show More
@@ -187,7 +187,7 define([ | |||
|
187 | 187 | |
|
188 | 188 | WidgetManager.prototype._handle_comm_open = function (comm, msg) { |
|
189 | 189 | // Handle when a comm is opened. |
|
190 |
return this._create_model({model_name: msg.content.data. |
|
|
190 | return this._create_model({model_name: msg.content.data.model_name, comm: comm}); | |
|
191 | 191 | }; |
|
192 | 192 | |
|
193 | 193 | WidgetManager.prototype.create_model = function (model_name, target_name, init_state_callback) { |
@@ -142,7 +142,7 class Widget(LoggingConfigurable): | |||
|
142 | 142 | |
|
143 | 143 | Widget._call_widget_constructed(self) |
|
144 | 144 | if open_comm: |
|
145 | self.open() | |
|
145 | self.open() | |
|
146 | 146 | |
|
147 | 147 | def __del__(self): |
|
148 | 148 | """Object disposal""" |
@@ -165,11 +165,11 class Widget(LoggingConfigurable): | |||
|
165 | 165 | def set_comm(self, comm): |
|
166 | 166 | """Set's the comm of the widget.""" |
|
167 | 167 | self.comm = comm |
|
168 |
|
|
|
169 |
|
|
|
170 |
|
|
|
171 |
|
|
|
172 |
|
|
|
168 | self._model_id = self.model_id | |
|
169 | ||
|
170 | self.comm.on_msg(self._handle_msg) | |
|
171 | Widget.widgets[self.model_id] = self | |
|
172 | ||
|
173 | 173 | # first update |
|
174 | 174 | self.send_state() |
|
175 | 175 | |
@@ -359,8 +359,8 class Widget(LoggingConfigurable): | |||
|
359 | 359 | if self.comm is not None and name in self.keys: |
|
360 | 360 | # Make sure this isn't information that the front-end just sent us. |
|
361 | 361 | if self._should_send_property(name, new_value): |
|
362 | # Send new state to front-end | |
|
363 | self.send_state(key=name) | |
|
362 | # Send new state to front-end | |
|
363 | self.send_state(key=name) | |
|
364 | 364 | |
|
365 | 365 | def _handle_displayed(self, **kwargs): |
|
366 | 366 | """Called when a view has been displayed for this widget instance""" |
General Comments 0
You need to be logged in to leave comments.
Login now