add 'widgetinit' event for users to enhance widgets and markup post 'widgetcreate'

This commit is contained in:
John Bender 2011-09-15 15:14:34 -07:00
parent 150697c8d2
commit ae2e7f0dc4

View file

@ -8,6 +8,16 @@
(function( $, undefined ) {
$.widget( "mobile.widget", {
// decorate the parent _createWidget to trigger `widgetinit` for users
// who wish to do post post `widgetcreate` alterations/additions
//
// TODO create a pull request for jquery ui to trigger this event
// in the original _createWidget
_createWidget: function() {
$.Widget.prototype._createWidget.apply( this, arguments );
this._trigger( 'init' );
},
_getCreateOptions: function() {
var elem = this.element,