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

Commit

Permalink
addFirstLastClasses: Add it to widgets via $.extend, not $.widget, be…
Browse files Browse the repository at this point in the history
…cause it does not use any widget factory features.

(cherry picked from commit f12ece0)
  • Loading branch information
Gabriel Schulhof committed Feb 26, 2013
1 parent ab6dbff commit 5760035
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions 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, {
$.widget( "mobile.collapsibleset", $.mobile.widget, $.extend( {
options: {
initSelector: ":jqmData(role='collapsible-set')"
},
Expand Down Expand Up @@ -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 ) {
Expand Down
6 changes: 2 additions & 4 deletions js/widgets/controlgroup.js
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions js/widgets/listview.js
Expand Up @@ -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,
Expand Down Expand Up @@ -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 ) {
Expand Down

0 comments on commit 5760035

Please sign in to comment.