Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Widgets: Remove mobile base widget and extend $.widget instead. Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
arschmitz committed Jul 4, 2013
1 parent 05d100d commit 245e3d1
Show file tree
Hide file tree
Showing 20 changed files with 22 additions and 25 deletions.
2 changes: 1 addition & 1 deletion demos/_assets/js/h2widget.js
Expand Up @@ -101,7 +101,7 @@
});
//h2 widget
$( document ).on( "mobileinit", function(){
$.widget( "mobile.h2linker", $.mobile.widget, {
$.widget( "mobile.h2linker", {
options:{
initSelector: ":jqmData(quicklinks='true')"
},
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.mobile.widget.js
Expand Up @@ -8,7 +8,7 @@ define( [ "jquery", "./jquery.mobile.ns", "jquery.ui.widget" ], function( jQuery
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.widget", {
$.extend( $.Widget.prototype, {
_getCreateOptions: function() {

var elem = this.element,
Expand Down Expand Up @@ -57,7 +57,7 @@ $.widget( "mobile.widget", {
throw "Widget [" + this.widgetName + "]: " + msg;
}
});

$.mobile.widget = $.Widget;
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
});
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/collapsible.js
Expand Up @@ -15,7 +15,7 @@ define( [

var getAttr = $.mobile.getAttribute;

$.widget( "mobile.collapsible", $.mobile.widget, {
$.widget( "mobile.collapsible", {
options: {
expandCueText: " click to expand contents",
collapseCueText: " click to collapse contents",
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/collapsibleSet.js
Expand Up @@ -9,7 +9,7 @@ define( [ "jquery", "../jquery.mobile.widget", "./collapsible", "./addFirstLastC
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.collapsibleset", $.mobile.widget, $.extend( {
$.widget( "mobile.collapsibleset", $.extend( {
_create: function() {
var $el = this.element,
o = this.options,
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/controlgroup.js
Expand Up @@ -12,7 +12,7 @@ define( [ "jquery",
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.controlgroup", $.mobile.widget, $.extend( {
$.widget( "mobile.controlgroup", $.extend( {
options: {
theme: null,
shadow: false,
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/dialog.js
Expand Up @@ -9,7 +9,7 @@ define( [ "jquery", "../jquery.mobile.widget", "./page", "../jquery.mobile.navig
//>>excludeEnd("jqmBuildExclude");
(function( $, window, undefined ) {

$.widget( "mobile.dialog", $.mobile.widget, $.extend( {
$.widget( "mobile.dialog", $.extend( {
options: {
closeBtn: "left", /* Accepts left, right and none */
closeBtnText: "Close",
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/forms/button.js
Expand Up @@ -9,7 +9,7 @@ define( [ "jquery", "../../jquery.mobile.widget", "../../jquery.mobile.registry"
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.button", $.mobile.widget, {
$.widget( "mobile.button", {
options: {
theme: null,
icon: null,
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/forms/checkboxradio.js
Expand Up @@ -17,7 +17,7 @@ define( [ "jquery",
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.checkboxradio", $.mobile.widget, $.extend( {
$.widget( "mobile.checkboxradio", $.extend( {
options: {
theme: null,
mini: false
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/forms/rangeslider.js
Expand Up @@ -14,7 +14,7 @@ define( [ "jquery",
"./slider" ], function( jQuery ) {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
$.widget( "mobile.rangeslider", $.mobile.widget, $.extend( {
$.widget( "mobile.rangeslider", $.extend( {

options: {
theme: null,
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/forms/select.js
Expand Up @@ -9,7 +9,7 @@ define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", ".
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.selectmenu", $.mobile.widget, $.extend( {
$.widget( "mobile.selectmenu", $.extend( {
options: {
theme: null,
disabled: false,
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/forms/slider.js
Expand Up @@ -14,7 +14,7 @@ define( [ "jquery",
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.slider", $.mobile.widget, $.extend( {
$.widget( "mobile.slider", $.extend( {
widgetEventPrefix: "slide",

options: {
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/forms/textinput.js
Expand Up @@ -9,7 +9,7 @@ define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", ".
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.textinput", $.mobile.widget, {
$.widget( "mobile.textinput", {
options: {
theme: null,
corners: true,
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/listview.js
Expand Up @@ -11,7 +11,7 @@ define( [ "jquery", "../jquery.mobile.widget", "./page", "./addFirstLastClasses"

var getAttr = $.mobile.getAttribute;

$.widget( "mobile.listview", $.mobile.widget, $.extend( {
$.widget( "mobile.listview", $.extend( {

options: {
theme: null,
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/navbar.js
Expand Up @@ -10,7 +10,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.grid", "../jque
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.navbar", $.mobile.widget, {
$.widget( "mobile.navbar", {
options: {
iconpos: "top",
grid: null
Expand Down
3 changes: 1 addition & 2 deletions js/widgets/page.js
Expand Up @@ -7,7 +7,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.page", $.mobile.widget, {
$.widget( "mobile.page", {
options: {
theme: "a",
domCache: false,
Expand Down Expand Up @@ -55,7 +55,6 @@ $.widget( "mobile.page", $.mobile.widget, {
},

_setOptions: function( o ) {

if( o.theme !== undefined ) {
this.element.removeClass( "ui-body-" + this.options.theme ).addClass( "ui-body-" + o.theme );
}
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/panel.js
Expand Up @@ -9,7 +9,7 @@ define( [ "jquery", "../jquery.mobile.widget", "./page", "../jquery.mobile.regis
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.panel", $.mobile.widget, {
$.widget( "mobile.panel", {
options: {
classes: {
panel: "ui-panel",
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/popup.js
Expand Up @@ -52,7 +52,7 @@ function windowCoords() {
};
}

$.widget( "mobile.popup", $.mobile.widget, {
$.widget( "mobile.popup", {
options: {
theme: null,
overlayTheme: null,
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/table.js
Expand Up @@ -9,7 +9,7 @@ define( [ "jquery", "../jquery.mobile.widget", "./page", "../jquery.mobile.regis
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.table", $.mobile.widget, {
$.widget( "mobile.table", {
options: {
classes: {
table: "ui-table"
Expand Down
6 changes: 2 additions & 4 deletions js/widgets/tabs.js
Expand Up @@ -8,11 +8,9 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core","./jquery
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget("mobile.tabs", $.mobile.widget, $.ui.tabs.prototype);
$.ui.tabs.initSelector = ":jqmData(role='tabs'), :jqmData(content='tabs')";

$.mobile.tabs.initSelector = ":jqmData(role='tabs'), :jqmData(content='tabs')";

$.mobile._enhancer.add( "mobile.tabs" );
$.mobile._enhancer.add( "ui.tabs" );

})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/toolbar.js
Expand Up @@ -10,7 +10,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.core", "../jque
(function( $, undefined ) {


$.widget( "mobile.toolbar", $.mobile.widget, {
$.widget( "mobile.toolbar", {
options: {
theme: null,
addBackBtn: false,
Expand Down

0 comments on commit 245e3d1

Please sign in to comment.