Permalink
Browse files

All: Delegate to base `_getCreateOptions()`.

Ensures that any extensions to the base widget will be handled properly by
individual widgets.

Closes gh-1598
  • Loading branch information...
scottgonzalez committed Sep 16, 2015
1 parent afbcdbe commit e19d462f16f619dbc56824e00d5c409ccd677f8d
Showing with 14 additions and 5 deletions.
  1. +4 −1 tests/unit/widget/core.js
  2. +3 −1 ui/widget.js
  3. +5 −1 ui/widgets/selectmenu.js
  4. +2 −2 ui/widgets/spinner.js
@@ -267,14 +267,17 @@ test( "merge multiple option arguments", function() {
} );
test( "._getCreateOptions()", function() {
expect( 3 );
expect( 4 );
$.widget( "ui.testWidget", {
options: {
option1: "valuex",
option2: "valuex",
option3: "value3"
},
_getCreateOptions: function() {
var superOptions = this._super();
deepEqual( superOptions, {}, "Base implementation returns empty object" );
// Support: IE8
// Strict equality fails when comparing this.window in ie8
View
@@ -322,7 +322,9 @@ $.Widget.prototype = {
this._init();
},
_getCreateOptions: $.noop,
_getCreateOptions: function() {
return {};
},
_getCreateEventData: $.noop,
View
@@ -646,7 +646,11 @@ return $.widget( "ui.selectmenu", {
},
_getCreateOptions: function() {
return { disabled: this.element.prop( "disabled" ) };
var options = this._super();
options.disabled = this.element.prop( "disabled" );
return options;
},
_parseOptions: function( options ) {
View
@@ -104,8 +104,8 @@ $.widget( "ui.spinner", {
},
_getCreateOptions: function() {
var options = {},
element = this.element;
var options = this._super();
var element = this.element;
$.each( [ "min", "max", "step" ], function( i, option ) {
var value = element.attr( option );

0 comments on commit e19d462

Please sign in to comment.