mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-22 08:50:30 +00:00
42 lines
977 B
JavaScript
42 lines
977 B
JavaScript
/*
|
|
* jQuery Mobile Framework : widget factory extentions for mobile
|
|
* Copyright (c) jQuery Project
|
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
* http://jquery.org/license
|
|
*/
|
|
|
|
(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,
|
|
options = {};
|
|
|
|
$.each( this.options, function( option ) {
|
|
|
|
var value = elem.jqmData( option.replace( /[A-Z]/g, function( c ) {
|
|
return "-" + c.toLowerCase();
|
|
})
|
|
);
|
|
|
|
if ( value !== undefined ) {
|
|
options[ option ] = value;
|
|
}
|
|
});
|
|
|
|
return options;
|
|
}
|
|
});
|
|
|
|
})( jQuery );
|