Permalink
Browse files

addFirstLastClasses: Add it to widgets via $.extend, not $.widget, be…

…cause it does not use any widget factory features.

(cherry picked from commit f12ece0)
  • Loading branch information...
1 parent ab6dbff commit 57600356c26ce979ab4ab6fbed863d6a7c7fabc4 @gabrielschulhof gabrielschulhof committed Feb 26, 2013
Showing with 6 additions and 12 deletions.
  1. +2 −4 js/widgets/collapsibleSet.js
  2. +2 −4 js/widgets/controlgroup.js
  3. +2 −4 js/widgets/listview.js
@@ -9,7 +9,7 @@ define( [ "jquery", "../jquery.mobile.widget", "./collapsible", "./addFirstLastC
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
-$.widget( "mobile.collapsibleset", $.mobile.widget, {
+$.widget( "mobile.collapsibleset", $.mobile.widget, $.extend( {
options: {
initSelector: ":jqmData(role='collapsible-set')"
},
@@ -78,9 +78,7 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, {
refresh: function() {
this._refresh( false );
}
-});
-
-$.widget( "mobile.collapsibleset", $.mobile.collapsibleset, $.mobile.behaviors.addFirstLastClasses );
+}, $.mobile.behaviors.addFirstLastClasses ) );
//auto self-init widgets
$.mobile.document.bind( "pagecreate create", function( e ) {
@@ -12,7 +12,7 @@ define( [ "jquery",
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {
- $.widget( "mobile.controlgroup", $.mobile.widget, {
+ $.widget( "mobile.controlgroup", $.mobile.widget, $.extend( {
options: {
shadow: false,
corners: true,
@@ -97,9 +97,7 @@ define( [ "jquery",
this._addFirstLastClasses( els, this.options.excludeInvisible ? this._getVisibles( els, create ) : els, create );
this._initialRefresh = false;
}
- });
-
- $.widget( "mobile.controlgroup", $.mobile.controlgroup, $.mobile.behaviors.addFirstLastClasses );
+ }, $.mobile.behaviors.addFirstLastClasses ) );
// TODO: Implement a mechanism to allow widgets to become enhanced in the
// correct order when their correct enhancement depends on other widgets in
@@ -14,7 +14,7 @@ define( [ "jquery", "../jquery.mobile.widget", "../jquery.mobile.buttonMarkup",
//https://github.com/jquery/jquery-mobile/issues/1617
var listCountPerPage = {};
-$.widget( "mobile.listview", $.mobile.widget, {
+$.widget( "mobile.listview", $.mobile.widget, $.extend( {
options: {
theme: null,
@@ -378,9 +378,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
return $( ":jqmData(url^='"+ parentUrl + "&" + $.mobile.subPageUrlKey + "')" );
}
-});
-
-$.widget( "mobile.listview", $.mobile.listview, $.mobile.behaviors.addFirstLastClasses );
+}, $.mobile.behaviors.addFirstLastClasses ) );
//auto self-init widgets
$.mobile.document.bind( "pagecreate create", function( e ) {

0 comments on commit 5760035

Please sign in to comment.