##// END OF EJS Templates
Merge pull request #6532 from SylvainCorlay/barewidgetmodels...
Thomas Kluyver -
r17992:398a03e4 merge
parent child Browse files
Show More
@@ -593,6 +593,7 b' define(["widgets/js/manager",'
593 },
593 },
594 });
594 });
595
595
596
596 var widget = {
597 var widget = {
597 'WidgetModel': WidgetModel,
598 'WidgetModel': WidgetModel,
598 'WidgetView': WidgetView,
599 'WidgetView': WidgetView,
@@ -100,7 +100,7 b' class Widget(LoggingConfigurable):'
100 #-------------------------------------------------------------------------
100 #-------------------------------------------------------------------------
101 _model_name = Unicode('WidgetModel', help="""Name of the backbone model
101 _model_name = Unicode('WidgetModel', help="""Name of the backbone model
102 registered in the front-end to create and sync this widget with.""")
102 registered in the front-end to create and sync this widget with.""")
103 _view_name = Unicode('WidgetView', help="""Default view registered in the front-end
103 _view_name = Unicode(None, allow_none=True, help="""Default view registered in the front-end
104 to use to represent the widget.""", sync=True)
104 to use to represent the widget.""", sync=True)
105 comm = Instance('IPython.kernel.comm.Comm')
105 comm = Instance('IPython.kernel.comm.Comm')
106
106
@@ -368,10 +368,10 b' class Widget(LoggingConfigurable):'
368
368
369 def _ipython_display_(self, **kwargs):
369 def _ipython_display_(self, **kwargs):
370 """Called when `IPython.display.display` is called on the widget."""
370 """Called when `IPython.display.display` is called on the widget."""
371 # Show view. By sending a display message, the comm is opened and the
371 # Show view.
372 # initial state is sent.
372 if self._view_name is not None:
373 self._send({"method": "display"})
373 self._send({"method": "display"})
374 self._handle_displayed(**kwargs)
374 self._handle_displayed(**kwargs)
375
375
376 def _send(self, msg):
376 def _send(self, msg):
377 """Sends a message to the model in the front-end."""
377 """Sends a message to the model in the front-end."""
General Comments 0
You need to be logged in to leave comments. Login now