diff options
25 files changed, 98 insertions, 176 deletions
diff --git a/tests/unit/accordion/accordio.html b/tests/unit/accordion/accordio.html index 4e4df72b4..69d445d1d 100644 --- a/tests/unit/accordion/accordio.html +++ b/tests/unit/accordion/accordio.html @@ -51,7 +51,6 @@ <script src="accordion_events.js"></script> <script src="accordion_methods.js"></script> <script src="accordion_options.js"></script> - <script src="accordion_tickets.js"></script> <script src="accordion_deprecated.js"></script> <script src="../swarminject.js"></script> diff --git a/tests/unit/accordion/accordion.html b/tests/unit/accordion/accordion.html index 65fd16ab6..be9ceb05d 100644 --- a/tests/unit/accordion/accordion.html +++ b/tests/unit/accordion/accordion.html @@ -54,7 +54,6 @@ <script src="accordion_events.js"></script> <script src="accordion_methods.js"></script> <script src="accordion_options.js"></script> - <script src="accordion_tickets.js"></script> <script src="../swarminject.js"></script> <style> diff --git a/tests/unit/accordion/accordion_tickets.js b/tests/unit/accordion/accordion_tickets.js deleted file mode 100644 index b301051da..000000000 --- a/tests/unit/accordion/accordion_tickets.js +++ /dev/null @@ -1,5 +0,0 @@ -(function( $ ) { - -module( "accordion: tickets", accordionSetupTeardown() ); - -}( jQuery ) ); diff --git a/tests/unit/autocomplete/autocomplete.html b/tests/unit/autocomplete/autocomplete.html index bc6388a75..8f1d9db9a 100644 --- a/tests/unit/autocomplete/autocomplete.html +++ b/tests/unit/autocomplete/autocomplete.html @@ -23,7 +23,6 @@ <script type="text/javascript" src="autocomplete_events.js"></script> <script type="text/javascript" src="autocomplete_methods.js"></script> <script type="text/javascript" src="autocomplete_options.js"></script> - <script type="text/javascript" src="autocomplete_tickets.js"></script> <script type="text/javascript" src="../swarminject.js"></script> </head> diff --git a/tests/unit/autocomplete/autocomplete_defaults.js b/tests/unit/autocomplete/autocomplete_defaults.js index e2196ea9e..dd5007089 100644 --- a/tests/unit/autocomplete/autocomplete_defaults.js +++ b/tests/unit/autocomplete/autocomplete_defaults.js @@ -4,7 +4,7 @@ var autocomplete_defaults = { appendTo: "body", - autoFocus: true, + autoFocus: false, delay: 300, disabled: false, minLength: 1, diff --git a/tests/unit/autocomplete/autocomplete_tickets.js b/tests/unit/autocomplete/autocomplete_tickets.js deleted file mode 100644 index bde9faffd..000000000 --- a/tests/unit/autocomplete/autocomplete_tickets.js +++ /dev/null @@ -1,14 +0,0 @@ -/* - * autocomplete_tickets.js - */ -(function($) { - -module("autocomplete: tickets", { - teardown: function() { - $( ":ui-autocomplete" ).autocomplete( "destroy" ); - } -}); - - - -})(jQuery); diff --git a/tests/unit/draggable/draggable.html b/tests/unit/draggable/draggable.html index 7ddf53e48..ca5e77e78 100644 --- a/tests/unit/draggable/draggable.html +++ b/tests/unit/draggable/draggable.html @@ -20,7 +20,6 @@ <script type="text/javascript" src="draggable_events.js"></script> <script type="text/javascript" src="draggable_methods.js"></script> <script type="text/javascript" src="draggable_options.js"></script> - <script type="text/javascript" src="draggable_tickets.js"></script> <script type="text/javascript"> // disable this stale testsuite for testswarm only diff --git a/tests/unit/draggable/draggable_tickets.js b/tests/unit/draggable/draggable_tickets.js deleted file mode 100644 index 709e55104..000000000 --- a/tests/unit/draggable/draggable_tickets.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * draggable_tickets.js - */ -(function($) { - -module("draggable: tickets"); - -})(jQuery); diff --git a/tests/unit/droppable/droppable.html b/tests/unit/droppable/droppable.html index 1655bda63..ebe745836 100644 --- a/tests/unit/droppable/droppable.html +++ b/tests/unit/droppable/droppable.html @@ -21,7 +21,6 @@ <script type="text/javascript" src="droppable_events.js"></script> <script type="text/javascript" src="droppable_methods.js"></script> <script type="text/javascript" src="droppable_options.js"></script> - <script type="text/javascript" src="droppable_tickets.js"></script> <script type="text/javascript"> // disable this stale testsuite for testswarm only diff --git a/tests/unit/droppable/droppable_tickets.js b/tests/unit/droppable/droppable_tickets.js deleted file mode 100644 index 05eeaa2a3..000000000 --- a/tests/unit/droppable/droppable_tickets.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * droppable_tickets.js - */ -(function($) { - -module("droppable: tickets"); - -})(jQuery); diff --git a/tests/unit/progressbar/progressbar.html b/tests/unit/progressbar/progressbar.html index 02066b37e..8048203f8 100644 --- a/tests/unit/progressbar/progressbar.html +++ b/tests/unit/progressbar/progressbar.html @@ -21,7 +21,6 @@ <script type="text/javascript" src="progressbar_events.js"></script> <script type="text/javascript" src="progressbar_methods.js"></script> <script type="text/javascript" src="progressbar_options.js"></script> - <script type="text/javascript" src="progressbar_tickets.js"></script> <script type="text/javascript" src="../swarminject.js"></script> </head> diff --git a/tests/unit/progressbar/progressbar_tickets.js b/tests/unit/progressbar/progressbar_tickets.js deleted file mode 100644 index debd62614..000000000 --- a/tests/unit/progressbar/progressbar_tickets.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * progressbar_tickets.js - */ -(function($) { - -module("progressbar: tickets"); - -})(jQuery); diff --git a/tests/unit/resizable/resizable.html b/tests/unit/resizable/resizable.html index 926201ce3..cb88c6751 100644 --- a/tests/unit/resizable/resizable.html +++ b/tests/unit/resizable/resizable.html @@ -22,7 +22,6 @@ <script type="text/javascript" src="resizable_events.js"></script> <script type="text/javascript" src="resizable_methods.js"></script> <script type="text/javascript" src="resizable_options.js"></script> - <script type="text/javascript" src="resizable_tickets.js"></script> <script type="text/javascript"> // disable this stale testsuite for testswarm only diff --git a/tests/unit/resizable/resizable_tickets.js b/tests/unit/resizable/resizable_tickets.js deleted file mode 100644 index 55486655c..000000000 --- a/tests/unit/resizable/resizable_tickets.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * resizable_tickets.js - */ -(function($) { - -module("resizable: tickets"); - -})(jQuery); diff --git a/tests/unit/selectable/selectable.html b/tests/unit/selectable/selectable.html index 7b739316d..85e843cda 100644 --- a/tests/unit/selectable/selectable.html +++ b/tests/unit/selectable/selectable.html @@ -20,7 +20,6 @@ <script type="text/javascript" src="selectable_events.js"></script> <script type="text/javascript" src="selectable_methods.js"></script> <script type="text/javascript" src="selectable_options.js"></script> - <script type="text/javascript" src="selectable_tickets.js"></script> <script type="text/javascript"> // disable this stale testsuite for testswarm only diff --git a/tests/unit/selectable/selectable_tickets.js b/tests/unit/selectable/selectable_tickets.js deleted file mode 100644 index da1da46de..000000000 --- a/tests/unit/selectable/selectable_tickets.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * selectable_tickets.js - */ -(function($) { - -module("selectable: tickets"); - -})(jQuery); diff --git a/tests/unit/slider/slider.html b/tests/unit/slider/slider.html index 04234903e..6dc84660b 100644 --- a/tests/unit/slider/slider.html +++ b/tests/unit/slider/slider.html @@ -22,7 +22,6 @@ <script type="text/javascript" src="slider_events.js"></script> <script type="text/javascript" src="slider_methods.js"></script> <script type="text/javascript" src="slider_options.js"></script> - <script type="text/javascript" src="slider_tickets.js"></script> <script type="text/javascript"> // disable this stale testsuite for testswarm only diff --git a/tests/unit/slider/slider_methods.js b/tests/unit/slider/slider_methods.js index 77ae65148..4b2b0311d 100644 --- a/tests/unit/slider/slider_methods.js +++ b/tests/unit/slider/slider_methods.js @@ -74,7 +74,7 @@ test("value", function() { value: 5 }); equals(el.slider('value'), 5, 'range: ' + this + ' slider method get'); - el.slider('value', 10); + equals(el.slider('value', 10), el, 'value method is chainable'); equals(el.slider('value'), 10, 'range: ' + this + ' slider method set'); el.remove(); }); @@ -85,13 +85,13 @@ test("value", function() { el.slider('option', 'value', -2); equals(el.slider('option', 'value'), -2, 'value option does not respect min'); equals(el.slider('value'), -1, 'value method get respects min'); - el.slider('value', -2); + equals(el.slider('value', -2), el, 'value method is chainable'); equals(el.slider('option', 'value'), -1, 'value method set respects min'); // max with value option vs value method el.slider('option', 'value', 2); equals(el.slider('option', 'value'), 2, 'value option does not respect max'); equals(el.slider('value'), 1, 'value method get respects max'); - el.slider('value', 2); + equals(el.slider('value', 2), el, 'value method is chainable'); equals(el.slider('option', 'value'), 1, 'value method set respects max'); }); diff --git a/tests/unit/slider/slider_tickets.js b/tests/unit/slider/slider_tickets.js deleted file mode 100644 index 7397c60ba..000000000 --- a/tests/unit/slider/slider_tickets.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * slider_tickets.js - */ -(function($) { - -module("slider: tickets"); - -})(jQuery); diff --git a/tests/unit/widget/widget.html b/tests/unit/widget/widget.html index 910345e4f..e74abb317 100644 --- a/tests/unit/widget/widget.html +++ b/tests/unit/widget/widget.html @@ -14,7 +14,6 @@ <script src="../testsuite.js"></script> <script src="widget_core.js"></script> - <script src="widget_tickets.js"></script> <script src="../swarminject.js"></script> </head> diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js index 34f5ef67f..5a6717560 100644 --- a/tests/unit/widget/widget_core.js +++ b/tests/unit/widget/widget_core.js @@ -288,6 +288,45 @@ test( "re-init", function() { same( actions, [ "optionfoo", "init" ], "correct methods called on re-init with options" ); }); +test( "inheritance - options", function() { + // #5830 - Widget: Using inheritance overwrites the base classes options + $.widget( "ui.testWidgetBase", { + options: { + obj: { + key1: "foo", + key2: "bar" + }, + arr: [ "testing" ] + } + }); + + $.widget( "ui.testWidgetExtension", $.ui.testWidgetBase, { + options: { + obj: { + key1: "baz" + }, + arr: [ "alpha", "beta" ] + } + }); + + same( $.ui.testWidgetBase.prototype.options.obj, { + key1: "foo", + key2: "bar" + }, "base class option object not overridden"); + same( $.ui.testWidgetBase.prototype.options.arr, [ "testing" ], + "base class option array not overridden"); + + same( $.ui.testWidgetExtension.prototype.options.obj, { + key1: "baz", + key2: "bar" + }, "extension class option object extends base"); + same( $.ui.testWidgetExtension.prototype.options.arr, [ "alpha", "beta" ], + "extension class option array overwrites base"); + + delete $.ui.testWidgetBase; + delete $.ui.testWidgetExtension; +}); + test( "._super()", function() { expect( 9 ); var instance; @@ -795,6 +834,55 @@ test( "._trigger() - provide event and ui", function() { .testWidget( "testEvent" ); }); +test( "._trigger() - array as ui", function() { + // #6795 - Widget: handle array arguments to _trigger consistently + expect( 4 ); + + $.widget( "ui.testWidget", { + _create: function() {}, + testEvent: function() { + var ui = { + foo: "bar", + baz: { + qux: 5, + quux: 20 + } + }; + var extra = { + bar: 5 + }; + this._trigger( "foo", null, [ ui, extra ] ); + } + }); + $( "#widget" ).bind( "testwidgetfoo", function( event, ui, extra ) { + same( ui, { + foo: "bar", + baz: { + qux: 5, + quux: 20 + } + }, "event: ui hash passed" ); + same( extra, { + bar: 5 + }, "event: extra argument passed" ); + }); + $( "#widget" ).testWidget({ + foo: function( event, ui, extra ) { + same( ui, { + foo: "bar", + baz: { + qux: 5, + quux: 20 + } + }, "callback: ui hash passed" ); + same( extra, { + bar: 5 + }, "callback: extra argument passed" ); + } + }) + .testWidget( "testEvent" ); +}); + test( "._trigger() - instance as element", function() { expect( 4 ); $.widget( "ui.testWidget", { diff --git a/tests/unit/widget/widget_tickets.js b/tests/unit/widget/widget_tickets.js deleted file mode 100644 index 9c0bddf03..000000000 --- a/tests/unit/widget/widget_tickets.js +++ /dev/null @@ -1,91 +0,0 @@ -(function( $ ) { - -module( "widget: tickets" ); - -test( "#5830 - Widget: Using inheritance overwrites the base classes options", function() { - $.widget( "ui.testWidgetBase", { - options: { - obj: { - key1: "foo", - key2: "bar" - }, - arr: [ "testing" ] - } - }); - - $.widget( "ui.testWidgetExtension", $.ui.testWidgetBase, { - options: { - obj: { - key1: "baz" - }, - arr: [ "alpha", "beta" ] - } - }); - - same( $.ui.testWidgetBase.prototype.options.obj, { - key1: "foo", - key2: "bar" - }, "base class option object not overridden"); - same( $.ui.testWidgetBase.prototype.options.arr, [ "testing" ], - "base class option array not overridden"); - - same( $.ui.testWidgetExtension.prototype.options.obj, { - key1: "baz", - key2: "bar" - }, "extension class option object extends base"); - same( $.ui.testWidgetExtension.prototype.options.arr, [ "alpha", "beta" ], - "extension class option array overwrites base"); - - delete $.ui.testWidgetBase; - delete $.ui.testWidgetExtension; -}); - -test( "#6795 - Widget: handle array arguments to _trigger consistently", function() { - expect( 4 ); - - $.widget( "ui.testWidget", { - _create: function() {}, - testEvent: function() { - var ui = { - foo: "bar", - baz: { - qux: 5, - quux: 20 - } - }; - var extra = { - bar: 5 - }; - this._trigger( "foo", null, [ ui, extra ] ); - } - }); - $( "#widget" ).bind( "testwidgetfoo", function( event, ui, extra ) { - same( ui, { - foo: "bar", - baz: { - qux: 5, - quux: 20 - } - }, "event: ui hash passed" ); - same( extra, { - bar: 5 - }, "event: extra argument passed" ); - }); - $( "#widget" ).testWidget({ - foo: function( event, ui, extra ) { - same( ui, { - foo: "bar", - baz: { - qux: 5, - quux: 20 - } - }, "callback: ui hash passed" ); - same( extra, { - bar: 5 - }, "callback: extra argument passed" ); - } - }) - .testWidget( "testEvent" ); -}); - -}( jQuery ) ); diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index ca06fff65..1685c0652 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -22,7 +22,7 @@ $.widget( "ui.autocomplete", { defaultElement: "<input>", options: { appendTo: "body", - autoFocus: true, + autoFocus: false, delay: 300, minLength: 1, position: { diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index 9745419dc..51f6b71d7 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -141,12 +141,12 @@ $.each( [ "Width", "Height" ], function( i, name ) { function reduce( elem, size, border, margin ) { $.each( side, function() { - size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0; + size -= parseFloat( $.curCSS( elem, "padding" + this, true ) ) || 0; if ( border ) { - size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0; + size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true ) ) || 0; } if ( margin ) { - size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0; + size -= parseFloat( $.curCSS( elem, "margin" + this, true ) ) || 0; } }); return size; diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js index 38c5996d0..eb6545f62 100644 --- a/ui/jquery.ui.slider.js +++ b/ui/jquery.ui.slider.js @@ -466,6 +466,7 @@ $.widget( "ui.slider", $.ui.mouse, { this.options.value = this._trimAlignValue( newValue ); this._refreshValue(); this._change( null, 0 ); + return; } return this._value(); @@ -480,6 +481,7 @@ $.widget( "ui.slider", $.ui.mouse, { this.options.values[ index ] = this._trimAlignValue( newValue ); this._refreshValue(); this._change( null, index ); + return; } if ( arguments.length ) { |