##// END OF EJS Templates
Merge pull request #4933 from jdfreder/widget-model-name...
Brian E. Granger -
r15005:f55d3710 merge
parent child Browse files
Show More
@@ -23,7 +23,7 b''
23 // elsewhere.
23 // elsewhere.
24 define(["underscore",
24 define(["underscore",
25 "backbone",
25 "backbone",
26 ], function (Underscore, Backbone) {
26 ], function (_, Backbone) {
27
27
28 //--------------------------------------------------------------------
28 //--------------------------------------------------------------------
29 // WidgetManager class
29 // WidgetManager class
@@ -17,7 +17,7 b''
17 define(["notebook/js/widgetmanager",
17 define(["notebook/js/widgetmanager",
18 "underscore",
18 "underscore",
19 "backbone"],
19 "backbone"],
20 function(WidgetManager, Underscore, Backbone){
20 function(WidgetManager, _, Backbone){
21
21
22 var WidgetModel = Backbone.Model.extend({
22 var WidgetModel = Backbone.Model.extend({
23 constructor: function (widget_manager, model_id, comm) {
23 constructor: function (widget_manager, model_id, comm) {
@@ -79,7 +79,7 b' class Widget(LoggingConfigurable):'
79 #-------------------------------------------------------------------------
79 #-------------------------------------------------------------------------
80 # Traits
80 # Traits
81 #-------------------------------------------------------------------------
81 #-------------------------------------------------------------------------
82 model_name = Unicode('WidgetModel', help="""Name of the backbone model
82 _model_name = Unicode('WidgetModel', help="""Name of the backbone model
83 registered in the front-end to create and sync this widget with.""")
83 registered in the front-end to create and sync this widget with.""")
84 _view_name = Unicode(help="""Default view registered in the front-end
84 _view_name = Unicode(help="""Default view registered in the front-end
85 to use to represent the widget.""", sync=True)
85 to use to represent the widget.""", sync=True)
@@ -121,7 +121,7 b' class Widget(LoggingConfigurable):'
121 If a Comm doesn't exist yet, a Comm will be created automagically."""
121 If a Comm doesn't exist yet, a Comm will be created automagically."""
122 if self._comm is None:
122 if self._comm is None:
123 # Create a comm.
123 # Create a comm.
124 self._comm = Comm(target_name=self.model_name)
124 self._comm = Comm(target_name=self._model_name)
125 self._comm.on_msg(self._handle_msg)
125 self._comm.on_msg(self._handle_msg)
126 self._comm.on_close(self._close)
126 self._comm.on_close(self._close)
127 Widget.widgets[self.model_id] = self
127 Widget.widgets[self.model_id] = self
General Comments 0
You need to be logged in to leave comments. Login now