diff --git a/IPython/html/static/widgets/js/widget.js b/IPython/html/static/widgets/js/widget.js index ae80f9e..66a88d1 100644 --- a/IPython/html/static/widgets/js/widget.js +++ b/IPython/html/static/widgets/js/widget.js @@ -413,7 +413,7 @@ define(["widgets/js/manager", this.model.on('change:_css', this.update_css, this); this.model.on('change:_dom_classes', function(model, new_classes) { - var old_classes = model.previous('children'); + var old_classes = model.previous('_dom_classes'); this.update_classes(old_classes, new_classes); }, this); diff --git a/IPython/html/tests/widgets/widget_box.js b/IPython/html/tests/widgets/widget_box.js index c92402c..6e1f242 100644 --- a/IPython/html/tests/widgets/widget_box.js +++ b/IPython/html/tests/widgets/widget_box.js @@ -36,16 +36,16 @@ casper.notebook_test(function () { }); index = this.append_cell( - 'container.set_css("float", "right")\n'+ + 'container.box_style = "success"\n'+ 'print("Success")\n'); this.execute_cell_then(index, function(index){ this.test.assertEquals(this.get_output_cell(index).text, 'Success\n', - 'Set container class CSS cell executed with correct output.'); - - this.test.assert(this.cell_element_function(container_index, - '.widget-area .widget-subarea .my-test-class', 'css', ['float'])=='right', - 'set_css works.'); + 'Set box_style cell executed with correct output.'); + + this.test.assert(this.cell_element_exists(container_index, + '.widget-box.alert-success'), + 'Set box_style works.'); }); index = this.append_cell( diff --git a/IPython/html/tests/widgets/widget_float.js b/IPython/html/tests/widgets/widget_float.js index 24294b4..291efb3 100644 --- a/IPython/html/tests/widgets/widget_float.js +++ b/IPython/html/tests/widgets/widget_float.js @@ -7,7 +7,7 @@ casper.notebook_test(function () { this.execute_cell_then(index); var float_text = {}; - float_text.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-float-text input'; + float_text.query = '.widget-area .widget-subarea .my-second-float-text input'; float_text.index = this.append_cell( 'float_widget = widgets.FloatText()\n' + 'display(float_widget)\n' + @@ -55,9 +55,9 @@ casper.notebook_test(function () { 'Invald float textbox value caught and filtered.'); }); - var float_text_query = '.widget-area .widget-subarea .widget-hbox-single .widget-numeric-text'; + var float_text_query = '.widget-area .widget-subarea .widget-numeric-text'; var slider = {}; - slider.query = '.widget-area .widget-subarea .widget-hbox-single .slider'; + slider.query = '.widget-area .widget-subarea .slider'; slider.index = this.append_cell( 'floatrange = [widgets.BoundedFloatText(), \n' + ' widgets.FloatSlider()]\n' + diff --git a/IPython/html/tests/widgets/widget_image.js b/IPython/html/tests/widgets/widget_image.js index 2cce2d0..ba10d35 100644 --- a/IPython/html/tests/widgets/widget_image.js +++ b/IPython/html/tests/widgets/widget_image.js @@ -23,9 +23,6 @@ casper.notebook_test(function () { 'image.value = data\n' + 'image.width = "50px"\n' + 'image.height = "50px"\n' + - // Set css that will make the image render within the PhantomJS visible - // window. If we don't do this, the captured image will be black. - 'image.set_css({"background": "blue", "z-index": "9999", "position": "fixed", "top": "0px", "left": "0px"})\n' + 'display(image)\n' + 'print("Success")\n'); this.execute_cell_then(image_index, function(index){ diff --git a/IPython/html/tests/widgets/widget_int.js b/IPython/html/tests/widgets/widget_int.js index a3a0263..409dfb6 100644 --- a/IPython/html/tests/widgets/widget_int.js +++ b/IPython/html/tests/widgets/widget_int.js @@ -7,7 +7,7 @@ casper.notebook_test(function () { this.execute_cell_then(index); var int_text = {}; - int_text.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-int-text input'; + int_text.query = '.widget-area .widget-subarea .my-second-int-text input'; int_text.index = this.append_cell( 'int_widget = widgets.IntText()\n' + 'display(int_widget)\n' + @@ -62,9 +62,9 @@ casper.notebook_test(function () { this.execute_cell_then(index); - var slider_query = '.widget-area .widget-subarea .widget-hbox-single .slider'; + var slider_query = '.widget-area .widget-subarea .slider'; var int_text2 = {}; - int_text2.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-num-test-text input'; + int_text2.query = '.widget-area .widget-subarea .my-second-num-test-text input'; int_text2.index = this.append_cell( 'intrange = [widgets.BoundedIntTextWidget(),\n' + ' widgets.IntSliderWidget()]\n' + diff --git a/IPython/html/widgets/widget_float.py b/IPython/html/widgets/widget_float.py index 64f2d3b..f7eaf20 100644 --- a/IPython/html/widgets/widget_float.py +++ b/IPython/html/widgets/widget_float.py @@ -165,7 +165,8 @@ class _BoundedFloatRange(_FloatRange): class FloatRangeSlider(_BoundedFloatRange): _view_name = Unicode('FloatSliderView', sync=True) - orientation = Enum([u'horizontal', u'vertical'], u'horizontal', + orientation = CaselessStrEnum(values=['horizontal', 'vertical'], + default_value='horizontal', allow_none=False, help="Vertical or horizontal.", sync=True) _range = Bool(True, help="Display a range selector", sync=True) readout = Bool(True, help="Display the current value of the slider next to it.", sync=True) diff --git a/IPython/html/widgets/widget_int.py b/IPython/html/widgets/widget_int.py index a98692c..1eebe5f 100644 --- a/IPython/html/widgets/widget_int.py +++ b/IPython/html/widgets/widget_int.py @@ -169,7 +169,8 @@ class _BoundedIntRange(_IntRange): class IntRangeSlider(_BoundedIntRange): _view_name = Unicode('IntSliderView', sync=True) - orientation = Enum([u'horizontal', u'vertical'], u'horizontal', + orientation = CaselessStrEnum(values=['horizontal', 'vertical'], + default_value='horizontal', allow_none=False, help="Vertical or horizontal.", sync=True) _range = Bool(True, help="Display a range selector", sync=True) readout = Bool(True, help="Display the current value of the slider next to it.", sync=True)