Skip to content
Permalink
Browse files

Widget: Added _getCreateEventData(). Fixes #8045 - Widget: Ability to…

… provide event data for create event.
  • Loading branch information...
scottgonzalez committed Jan 21, 2012
1 parent 0cf6bc0 commit da89fcbc07f236d43e6a1edd98603beea6e245b6
Showing with 17 additions and 1 deletion.
  1. +15 −0 tests/unit/widget/widget_core.js
  2. +2 −1 ui/jquery.ui.widget.js
@@ -261,6 +261,21 @@ test( "._getCreateOptions()", function() {
$( "<div>" ).testWidget({ option2: "value2" });
});

test( "._getCreateEventData()", function() {
expect( 1 );
var data = { foo: "bar" };
$.widget( "ui.testWidget", {
_getCreateEventData: function() {
return data;
}
});
$( "<div>" ).testWidget({
create: function( event, ui ) {
strictEqual( ui, data, "event data" );
}
});
});

test( "re-init", function() {
var div = $( "<div>" ),
actions = [];
@@ -204,10 +204,11 @@ $.Widget.prototype = {
}

this._create();
this._trigger( "create" );
this._trigger( "create", null, this._getCreateEventData() );
this._init();
},
_getCreateOptions: $.noop,
_getCreateEventData: $.noop,
_create: $.noop,
_init: $.noop,

0 comments on commit da89fcb

Please sign in to comment.
You can’t perform that action at this time.