Show More
@@ -117,7 +117,7 b' def display(*objs, **kwargs):' | |||
|
117 | 117 | |
|
118 | 118 | # If _ipython_display_ is defined, use that to display this object. If |
|
119 | 119 | # it returns NotImplemented, use the _repr_ logic (default). |
|
120 |
if not hasattr(obj, '_ipython_display_') or |
|
|
120 | if not hasattr(obj, '_ipython_display_') or obj._ipython_display_(**kwargs) == NotImplemented: | |
|
121 | 121 | if raw: |
|
122 | 122 | publish_display_data('display', obj, metadata) |
|
123 | 123 | else: |
@@ -15,7 +15,7 b'' | |||
|
15 | 15 | **/ |
|
16 | 16 | |
|
17 | 17 | define(["notebook/js/widgets/widget"], function(widget_manager){ |
|
18 |
var Check |
|
|
18 | var CheckBoxView = IPython.DOMWidgetView.extend({ | |
|
19 | 19 | |
|
20 | 20 | // Called when view is rendered. |
|
21 | 21 | render : function(){ |
@@ -60,12 +60,12 b' define(["notebook/js/widgets/widget"], function(widget_manager){' | |||
|
60 | 60 | this.$label.show(); |
|
61 | 61 | } |
|
62 | 62 | } |
|
63 |
return Check |
|
|
63 | return CheckBoxView.__super__.update.apply(this); | |
|
64 | 64 | }, |
|
65 | 65 | |
|
66 | 66 | }); |
|
67 | 67 | |
|
68 |
widget_manager.register_widget_view('Check |
|
|
68 | widget_manager.register_widget_view('CheckBoxView', CheckBoxView); | |
|
69 | 69 | |
|
70 | 70 | var ToggleButtonView = IPython.DOMWidgetView.extend({ |
|
71 | 71 |
@@ -166,7 +166,7 b' class Widget(LoggingConfigurable):' | |||
|
166 | 166 | def _handle_property_changed(self, name, old, new): |
|
167 | 167 | """Called when a property has been changed.""" |
|
168 | 168 | # Make sure this isn't information that the front-end just sent us. |
|
169 |
if should_send_property( |
|
|
169 | if self.should_send_property(name, new): | |
|
170 | 170 | # Send new state to front-end |
|
171 | 171 | self.send_state(key=name) |
|
172 | 172 |
@@ -27,6 +27,6 b' class CheckBoxWidget(DOMWidget):' | |||
|
27 | 27 | description = Unicode('', help="Description of the boolean (label).", sync=True) |
|
28 | 28 | disabled = Bool(False, help="Enable or disable user changes.", sync=True) |
|
29 | 29 | |
|
30 |
class ToggleButtonWidget(Check |
|
|
30 | class ToggleButtonWidget(CheckBoxWidget): | |
|
31 | 31 | view_name = Unicode('ToggleButtonView', sync=True) |
|
32 | 32 | No newline at end of file |
@@ -29,13 +29,13 b' class ToggleButtonsWidget(DOMWidget):' | |||
|
29 | 29 | description = Unicode(help="Description of the value this widget represents", sync=True) |
|
30 | 30 | |
|
31 | 31 | |
|
32 |
class DropdownWidget( |
|
|
32 | class DropdownWidget(ToggleButtonsWidget): | |
|
33 | 33 | view_name = Unicode('DropdownView', sync=True) |
|
34 | 34 | |
|
35 | 35 | |
|
36 |
class RadioButtonsWidget( |
|
|
36 | class RadioButtonsWidget(ToggleButtonsWidget): | |
|
37 | 37 | view_name = Unicode('RadioButtonsView', sync=True) |
|
38 | 38 | |
|
39 | 39 | |
|
40 |
class ListBoxWidget( |
|
|
40 | class ListBoxWidget(ToggleButtonsWidget): | |
|
41 | 41 | view_name = Unicode('ListBoxView', sync=True) |
General Comments 0
You need to be logged in to leave comments.
Login now