##// END OF EJS Templates
Address @minrk 's review comments.
Jonathan Frederic -
Show More
@@ -76,7 +76,7 b' define(["widgets/js/manager",'
76 76 this.set_state(msg.content.data.state);
77 77 if (this.init_state_callback) {
78 78 this.init_state_callback.apply(this, [this]);
79 this.init_state_callback = null;
79 delete this.init_state_callback;
80 80 }
81 81 break;
82 82 case 'custom':
@@ -102,7 +102,7 b' class Widget(LoggingConfigurable):'
102 102 target_name = msg['content']['data']['target_name']
103 103 widget_class = import_item(target_name)
104 104 widget = widget_class(open_comm=False)
105 widget.set_comm(comm)
105 widget.comm = comm
106 106
107 107
108 108 #-------------------------------------------------------------------------
@@ -160,11 +160,11 b' class Widget(LoggingConfigurable):'
160 160 'model_module': self._model_module})
161 161 if self._model_id is not None:
162 162 args['comm_id'] = self._model_id
163 self.set_comm(Comm(**args))
163 self.comm = Comm(**args)
164 164
165 def set_comm(self, comm):
166 """Set's the comm of the widget."""
167 self.comm = comm
165 def _comm_changed(self, name, new):
166 """Called when the comm is changed."""
167 self.comm = new
168 168 self._model_id = self.model_id
169 169
170 170 self.comm.on_msg(self._handle_msg)
@@ -173,7 +173,6 b' class Widget(LoggingConfigurable):'
173 173 # first update
174 174 self.send_state()
175 175
176
177 176 @property
178 177 def model_id(self):
179 178 """Gets the model id of this widget.
General Comments 0
You need to be logged in to leave comments. Login now