Address @minrk 's review comments.

pull/37/head
Jonathan Frederic 12 years ago
parent fbca0bfa3f
commit a68df8a8b1

@ -76,7 +76,7 @@ define(["widgets/js/manager",
this.set_state(msg.content.data.state);
if (this.init_state_callback) {
this.init_state_callback.apply(this, [this]);
this.init_state_callback = null;
delete this.init_state_callback;
}
break;
case 'custom':

@ -102,7 +102,7 @@ class Widget(LoggingConfigurable):
target_name = msg['content']['data']['target_name']
widget_class = import_item(target_name)
widget = widget_class(open_comm=False)
widget.set_comm(comm)
widget.comm = comm
#-------------------------------------------------------------------------
@ -160,11 +160,11 @@ class Widget(LoggingConfigurable):
'model_module': self._model_module})
if self._model_id is not None:
args['comm_id'] = self._model_id
self.set_comm(Comm(**args))
self.comm = Comm(**args)
def set_comm(self, comm):
"""Set's the comm of the widget."""
self.comm = comm
def _comm_changed(self, name, new):
"""Called when the comm is changed."""
self.comm = new
self._model_id = self.model_id
self.comm.on_msg(self._handle_msg)
@ -173,7 +173,6 @@ class Widget(LoggingConfigurable):
# first update
self.send_state()
@property
def model_id(self):
"""Gets the model id of this widget.

Loading…
Cancel
Save