From ab76ac33ac40403c5faaede6f8fdcb3e79be00a3 Mon Sep 17 00:00:00 2001 From: Steven Black Date: Thu, 26 May 2011 10:01:39 -0400 Subject: [PATCH 01/14] jquery.mobile.dialog.js: Whitespace changes and string delimiters, bringing this up to jQuery coding standards. Renamed one memory variable for legibility and clarity. Signed-off-by: Steven Black --- js/jquery.mobile.dialog.js | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/js/jquery.mobile.dialog.js b/js/jquery.mobile.dialog.js index 012d036e..e432f0b0 100644 --- a/js/jquery.mobile.dialog.js +++ b/js/jquery.mobile.dialog.js @@ -4,57 +4,56 @@ * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. * Note: Code is in draft form and is subject to change */ -(function($, undefined ) { +( function( $, undefined ) { $.widget( "mobile.dialog", $.mobile.widget, { options: { closeBtnText: "Close" }, - _create: function(){ + _create: function() { var self = this, $el = self.element; /* class the markup for dialog styling */ this.element //add ARIA role - .attr("role","dialog") - .addClass('ui-page ui-dialog ui-body-a') + .attr( "role", "dialog" ) + .addClass( "ui-page ui-dialog ui-body-a" ) .find( ":jqmData(role=header)" ) - .addClass('ui-corner-top ui-overlay-shadow') + .addClass( "ui-corner-top ui-overlay-shadow" ) .prepend( ""+ this.options.closeBtnText +"" ) .end() - .find('.ui-content:not([class*="ui-body-"])') - .addClass('ui-body-c') + .find( '.ui-content:not([class*="ui-body-"])' ) + .addClass( 'ui-body-c' ) .end() .find( ".ui-content,:jqmData(role='footer')" ) .last() - .addClass('ui-corner-bottom ui-overlay-shadow'); + .addClass( "ui-corner-bottom ui-overlay-shadow" ); /* bind events - clicks and submits should use the closing transition that the dialog opened with unless a data-transition is specified on the link/form - if the click was on the close button, or the link has a data-rel="back" it'll go back in history naturally */ - this.element - .bind( "vclick submit", function(e){ - var $targetel; + this.element + .bind( "vclick submit", function( e ) { + var $target; if( e.type == "vclick" ){ - $targetel = $(e.target).closest("a"); + $target = $( e.target ).closest( "a" ); } else{ - $targetel = $(e.target).closest("form"); + $target = $( e.target ).closest( "form" ); } - if( $targetel.length && !$targetel.jqmData("transition") ){ - $targetel - .attr("data-" + $.mobile.ns + "transition", $.mobile.urlHistory.getActive().transition ) - .attr("data-" + $.mobile.ns + "direction", "reverse"); + if( $target.length && !$target.jqmData( "transition" ) ){ + $target + .attr( "data-" + $.mobile.ns + "transition", $.mobile.urlHistory.getActive().transition ) + .attr( "data-" + $.mobile.ns + "direction", "reverse" ); } }); - }, //close method goes back in history - close: function(){ + close: function() { window.history.back(); } }); From d3df858eea3a607ae464c88801ace7194dc20e89 Mon Sep 17 00:00:00 2001 From: eddiemonge Date: Fri, 27 May 2011 12:13:48 -0700 Subject: [PATCH 02/14] missed an equal sign --- js/jquery.mobile.dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/jquery.mobile.dialog.js b/js/jquery.mobile.dialog.js index c6b8c73a..c7ce943a 100644 --- a/js/jquery.mobile.dialog.js +++ b/js/jquery.mobile.dialog.js @@ -35,7 +35,7 @@ $.widget( "mobile.dialog", $.mobile.widget, { */ $el .bind( "vclick submit", function( e ) { - var $target = $( e.target ).closest( e.type == "vclick" ? "a" : "form" ); + var $target = $( e.target ).closest( e.type === "vclick" ? "a" : "form" ); if( $target.length && !$target.jqmData( "transition" ) ) { $target From 244cda822aa84bf60d8b2d3b961662139809bb07 Mon Sep 17 00:00:00 2001 From: eddiemonge Date: Tue, 31 May 2011 14:44:31 -0700 Subject: [PATCH 03/14] add white space for code standard --- js/jquery.mobile.dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/jquery.mobile.dialog.js b/js/jquery.mobile.dialog.js index 359cfc27..922932d0 100644 --- a/js/jquery.mobile.dialog.js +++ b/js/jquery.mobile.dialog.js @@ -37,7 +37,7 @@ $.widget( "mobile.dialog", $.mobile.widget, { .bind( "vclick submit", function( e ) { var $target = $( e.target ).closest( e.type === "vclick" ? "a" : "form" ); - if( $target.length && !$target.jqmData( "transition" ) ) { + if( $target.length && ! $target.jqmData( "transition" ) ) { var active = $.mobile.urlHistory.getActive() || {}; $target .attr( "data-" + $.mobile.ns + "transition", ( active.transition || $.mobile.defaultDialogTransition ) ) From 757dda99d083a842eff95c09c6dd0cebaa035f7b Mon Sep 17 00:00:00 2001 From: eddiemonge Date: Thu, 2 Jun 2011 09:49:21 -0700 Subject: [PATCH 04/14] Makefile: Remove log as the info is now in the files from the nightly/latest build. Fix output name for the same --- Makefile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 9494835e..0991fd3a 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ JQUERY = $(shell grep Library js/jquery.js | sed s'/ \* jQuery JavaScript Librar # The directory to create the zipped files in and also serves as the filenames DIR = jquery.mobile-${VER} +nightly: DIR = jquery.mobile # The output folder for the finished files OUTPUT = compiled @@ -24,7 +25,6 @@ RMLATEST = echo "" NIGHTLY_OUTPUT = nightlies/${DATE} ifeq (${NIGHTLY_OUTPUT}, latest) RMLATEST = ssh jqadmin@code.origin.jquery.com 'rm -rf /var/www/html/code.jquery.com/mobile/latest' - DIR = jquery.mobile endif NIGHTLY_WEBPATH = http://code.jquery.com/mobile/${NIGHTLY_OUTPUT} @@ -136,12 +136,6 @@ zip: init js min css cssmin # Used by the jQuery team to make the nightly builds nightly: pull zip - # Create a log that lists the current version according to the code and the git information for the last commit - @@echo $$"\nGit Release Version: " >> ${OUTPUT}/log.txt - @@cat version.txt >> ${OUTPUT}/log.txt - @@echo $$"\nGit Information for this build:" >> ${OUTPUT}/log.txt - @@git log -1 --format=format:"SHA1: %H \nDate: %cd \nTitle: %s" >> ${OUTPUT}/log.txt - # Create the folder to hold the files for the demos @@mkdir -p ${VER} From b31825a1d70d0f8b87b1fd38cea35d4ddd638e82 Mon Sep 17 00:00:00 2001 From: Kin Blas Date: Thu, 2 Jun 2011 10:41:55 -0700 Subject: [PATCH 05/14] Fixed issue 1767 - loadPage/changePage broken in trunk (latest build) - Not sure how/why I added that extra absUrl, but its gone now. --- js/jquery.mobile.navigation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 7153dc72..6a4e2439 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -421,7 +421,7 @@ settings.data = $.param( settings.data ); } // XXX_jblas: We should be checking to see if the url already has a query in it. - absUrl += absUrl + "?" + settings.data; + absUrl += "?" + settings.data; settings.data = undefined; fileUrl = path.getFilePath( absUrl ); } From 489fc19fb1c212494fa43983bf72bad7c70bea4e Mon Sep 17 00:00:00 2001 From: Kin Blas Date: Thu, 2 Jun 2011 16:52:36 -0700 Subject: [PATCH 06/14] Unit test to catch issues like 1767. - Test passing string as data option to changePage(). - Test passing object as data option to changePage(). --- .../form-tests/changepage-data.html | 8 ++++ tests/unit/navigation/navigation_core.js | 37 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 tests/unit/navigation/form-tests/changepage-data.html diff --git a/tests/unit/navigation/form-tests/changepage-data.html b/tests/unit/navigation/form-tests/changepage-data.html new file mode 100644 index 00000000..2305c206 --- /dev/null +++ b/tests/unit/navigation/form-tests/changepage-data.html @@ -0,0 +1,8 @@ + + + + + +
+ + diff --git a/tests/unit/navigation/navigation_core.js b/tests/unit/navigation/navigation_core.js index d67aa12e..13238dd2 100644 --- a/tests/unit/navigation/navigation_core.js +++ b/tests/unit/navigation/navigation_core.js @@ -422,4 +422,41 @@ } ], 1000); }); + + asyncTest( "query data passed as string to changePage is appended to URL", function(){ + + $.testHelper.pageSequence([ + // open our test page + function(){ + $.mobile.changePage( "form-tests/changepage-data.html", { + data: "foo=1&bar=2" + } ); + }, + + function(){ + same(location.hash, "#form-tests/changepage-data.html?foo=1&bar=2"); + start(); + } + ]); + }); + + asyncTest( "query data passed as object to changePage is appended to URL", function(){ + + $.testHelper.pageSequence([ + // open our test page + function(){ + $.mobile.changePage( "form-tests/changepage-data.html", { + data: { + foo: 3, + bar: 4 + } + } ); + }, + + function(){ + same(location.hash, "#form-tests/changepage-data.html?foo=3&bar=4"); + start(); + } + ]); + }); })(jQuery); From 9e696b8d26c12b0f8a7391a37cda6cb9292d594d Mon Sep 17 00:00:00 2001 From: Kin Blas Date: Fri, 3 Jun 2011 09:29:41 -0700 Subject: [PATCH 07/14] Backing out commit for "fix height issue for transitioning page" https://github.com/jquery/jquery-mobile/pull/1723 https://github.com/jquery/jquery-mobile/commit/b2a534c217a4fa18918002a43db17bbdcd0a2a42 It was causing a few issues including: https://github.com/jquery/jquery-mobile/issues/1770 --- themes/default/jquery.mobile.core.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/default/jquery.mobile.core.css b/themes/default/jquery.mobile.core.css index 982b18dc..0d3bc064 100644 --- a/themes/default/jquery.mobile.core.css +++ b/themes/default/jquery.mobile.core.css @@ -14,14 +14,14 @@ .ui-mobile-viewport { margin: 0; overflow-x: hidden; -webkit-text-size-adjust: none; -ms-text-size-adjust:none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } /* "page" containers - full-screen views, one should always be in view post-pageload */ -.ui-mobile [data-role=page], .ui-mobile [data-role=dialog], .ui-page { top: 0; left: 0; width: 100%; min-height: 100%; height: auto !important; height: 100%; position: absolute; display: none; border: 0; } +.ui-mobile [data-role=page], .ui-mobile [data-role=dialog], .ui-page { top: 0; left: 0; width: 100%; min-height: 100%; position: absolute; display: none; border: 0; } .ui-mobile .ui-page-active { display: block; overflow: visible; } /*orientations from js are available */ .portrait, .portrait .ui-page, .landscape, -.landscape .ui-page { min-height: 100%; height: auto !important; height: 100%; } +.landscape .ui-page { min-height: 100%; } /* loading screen */ .ui-loading .ui-mobile-viewport { overflow: hidden !important; } From 14492002e27fe14ce9accddb6f544a5e90c77939 Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Fri, 3 Jun 2011 08:05:18 -0700 Subject: [PATCH 08/14] Fixed test case for issue #1617 --- tests/unit/listview/listview_core.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/unit/listview/listview_core.js b/tests/unit/listview/listview_core.js index 15d09e09..65527f86 100644 --- a/tests/unit/listview/listview_core.js +++ b/tests/unit/listview/listview_core.js @@ -122,7 +122,9 @@ function(){ $('.ui-page-active li:eq(2) a:eq(0)').click(); - + }, + + function(){ equal($('.ui-page-active .ui-content .ui-listview li').text(), "Sub Item 10Sub Item 11Sub Item 12", 'Text should be "Sub Item 10Sub Item 11Sub Item 12"'); start(); } From 3ee2585cba7f1e1b7cfeb2013a53c318aa00e4f7 Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Fri, 3 Jun 2011 08:08:18 -0700 Subject: [PATCH 09/14] Fix for issue #1617: Nested lists with same parent text resolve to the same sub-page. --- js/jquery.mobile.listview.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index 9fd9a660..3e29ded0 100644 --- a/js/jquery.mobile.listview.js +++ b/js/jquery.mobile.listview.js @@ -5,6 +5,10 @@ * http://jquery.org/license */ (function($, undefined ) { +//Keeps track of the number of lists per page UID +//This allows support for multiple nested list in the same page +//https://github.com/jquery/jquery-mobile/issues/1617 +var listCountPerPage = {}; $.widget( "mobile.listview", $.mobile.widget, { options: { @@ -189,23 +193,31 @@ $.widget( "mobile.listview", $.mobile.widget, { _idStringEscape: function( str ){ return str.replace(/[^a-zA-Z0-9]/g, '-'); }, - + _createSubPages: function() { var parentList = this.element, parentPage = parentList.closest( ".ui-page" ), - parentId = parentPage.jqmData( "url" ), + parentUrl = parentPage.jqmData( "url" ), + parentId = parentUrl || parentPage[ 0 ][ $.expando ], + parentListId = parentList.attr( "id" ), o = this.options, dns = "data-" + $.mobile.ns, self = this, persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ); + if ( typeof( listCountPerPage[ parentId ] ) === 'undefined' ) { + listCountPerPage[ parentId ] = -1; + } + parentListId = parentListId || ++listCountPerPage[ parentId ]; + $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function( i ) { var list = $( this ), + listId = list.attr( "id" ) || parentListId + "-" + i, parent = list.parent(), nodeEls = $( list.prevAll().toArray().reverse() ), nodeEls = nodeEls.length ? nodeEls : $( "" + $.trim(parent.contents()[ 0 ].nodeValue) + "" ), title = nodeEls.first().text(),//url limits to first 30 chars of text - id = parentId + "&" + $.mobile.subPageUrlKey + "=" + self._idStringEscape(title + " " + i), + id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId; theme = list.jqmData( "theme" ) || o.theme, countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme, newPage = list.detach() From 888a3d4fafaca5c25524d2179eb65b9f7d0662e4 Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Fri, 3 Jun 2011 10:03:44 -0700 Subject: [PATCH 10/14] Fixed nested lists tests following id generation change (8373105) --- tests/unit/listview/listview_core.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/unit/listview/listview_core.js b/tests/unit/listview/listview_core.js index 65527f86..40cd2622 100644 --- a/tests/unit/listview/listview_core.js +++ b/tests/unit/listview/listview_core.js @@ -63,8 +63,8 @@ function(){ ok($('#nested-list-test').hasClass('ui-page-active'), "makes nested list test page active"); - ok($(':jqmData(url="nested-list-test&ui-page=More-animals-0")').length == 1, "Adds first UL to the page"); - ok($(':jqmData(url="nested-list-test&ui-page=Groups-of-animals-1")').length == 1, "Adds second nested UL to the page"); + ok($(':jqmData(url="nested-list-test&ui-page=0-0")').length == 1, "Adds first UL to the page"); + ok($(':jqmData(url="nested-list-test&ui-page=0-1")').length == 1, "Adds second nested UL to the page"); start(); } ]); @@ -82,7 +82,7 @@ }, function(){ - var $new_page = $(':jqmData(url="nested-list-test&ui-page=More-animals-0")'); + var $new_page = $(':jqmData(url="nested-list-test&ui-page=0-0")'); ok($new_page.hasClass('ui-page-active'), 'Makes the nested page the active page.'); ok($('.ui-listview', $new_page).find(":contains('Rhumba of rattlesnakes')").length == 1, "The current page should have the proper text in the list."); @@ -95,7 +95,7 @@ asyncTest( "should go back to top level when the back button is clicked", function() { $.testHelper.pageSequence([ function(){ - $.testHelper.openPage("#nested-list-test&ui-page=More-animals-0"); + $.testHelper.openPage("#nested-list-test&ui-page=0-0"); }, function(){ @@ -113,7 +113,7 @@ ok($('#nested-list-test .linebreaknode').text() === "More animals", 'Text should be "More animals"'); }); - asyncTest( "Multiple nested lists on a page", function() { + asyncTest( "Multiple nested lists on a page with same labels", function() { $.testHelper.pageSequence([ function(){ // https://github.com/jquery/jquery-mobile/issues/1617 @@ -121,6 +121,7 @@ }, function(){ + // Click on the link of the third li element $('.ui-page-active li:eq(2) a:eq(0)').click(); }, From 6af27f9a7e528028de9bf80eed0a111f8916af5e Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Fri, 3 Jun 2011 11:06:44 -0700 Subject: [PATCH 11/14] Beefed up nested lists test --- tests/unit/listview/index.html | 38 ++++++++++++++++++++-------- tests/unit/listview/listview_core.js | 4 +-- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/tests/unit/listview/index.html b/tests/unit/listview/index.html index 4a30a43b..3e1fc50b 100644 --- a/tests/unit/listview/index.html +++ b/tests/unit/listview/index.html @@ -80,22 +80,40 @@
  • Item 1
  • Item 2
  • -
  • Parent Item +
  • Item 3
      -
    • Sub Item 10
    • -
    • Sub Item 11
    • -
    • Sub Item 12
    • +
    • Item A-3-0
    • +
    • Item A-3-1
    • +
    • Item A-3-2
    -
  • Item 3
  • -
  • Item 4
  • -
  • Parent Item +
  • Item 1
  • +
  • Item 2
  • +
  • Item 3
      -
    • Sub Item 20
    • -
    • Sub Item 21
    • -
    • Sub Item 22
    • +
    • Item B-3-0 +
        +
      • Item B-3-0-0
      • +
      • Item B-3-0-1 +
          +
        • Item B-3-0-1-0
        • +
        • Item B-3-0-1-1
        • +
        • Item B-3-0-1-2
        • +
        +
      • +
      • Item B-3-0-2
      • +
      +
    • +
    • Item B-3-1 +
        +
      • Item B-3-1-0
      • +
      • Item B-3-1-1
      • +
      • Item B-3-1-2
      • +
      +
    • +
    • Item B-3-2
diff --git a/tests/unit/listview/listview_core.js b/tests/unit/listview/listview_core.js index 40cd2622..dcc23a3d 100644 --- a/tests/unit/listview/listview_core.js +++ b/tests/unit/listview/listview_core.js @@ -126,7 +126,7 @@ }, function(){ - equal($('.ui-page-active .ui-content .ui-listview li').text(), "Sub Item 10Sub Item 11Sub Item 12", 'Text should be "Sub Item 10Sub Item 11Sub Item 12"'); + equal($('.ui-page-active .ui-content .ui-listview li').text(), "Item A-3-0Item A-3-1Item A-3-2", 'Text should be "Item A-3-0Item A-3-1Item A-3-2"'); start(); } ]); @@ -390,4 +390,4 @@ }, 1000); }); -})(jQuery); \ No newline at end of file +})(jQuery); From 9d3862c825a36ea7c3ea2ce3528b7c85a6025fab Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Fri, 3 Jun 2011 19:02:13 -0700 Subject: [PATCH 12/14] Whitespace change --- js/jquery.mobile.listview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index 3e29ded0..cd7600fb 100644 --- a/js/jquery.mobile.listview.js +++ b/js/jquery.mobile.listview.js @@ -206,8 +206,8 @@ $.widget( "mobile.listview", $.mobile.widget, { persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ); if ( typeof( listCountPerPage[ parentId ] ) === 'undefined' ) { - listCountPerPage[ parentId ] = -1; - } + listCountPerPage[ parentId ] = -1; + } parentListId = parentListId || ++listCountPerPage[ parentId ]; $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function( i ) { From f8957baec77a7414e4e9a8b42477ca4d90831a2a Mon Sep 17 00:00:00 2001 From: scottjehl Date: Wed, 8 Jun 2011 16:37:42 -0400 Subject: [PATCH 13/14] make sure options don't get text-indented. Fixes #1717 --- themes/default/jquery.mobile.forms.select.css | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/default/jquery.mobile.forms.select.css b/themes/default/jquery.mobile.forms.select.css index b2231b41..09fcac49 100644 --- a/themes/default/jquery.mobile.forms.select.css +++ b/themes/default/jquery.mobile.forms.select.css @@ -7,6 +7,7 @@ .ui-select select { position: absolute; left: -9999px; top: -9999px; } .ui-select .ui-btn { overflow: hidden; } .ui-select .ui-btn select { cursor: pointer; -webkit-appearance: button; left: 0; top:0; width: 100%; height: 100%; text-indent: -999em; opacity: 0.0001; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); } +.ui-select .ui-btn option { text-indent: 0; } .ui-select .ui-btn select.ui-select-nativeonly { opacity: 1; text-indent: 0; } .ui-select .ui-btn-icon-right .ui-btn-inner { padding-right: 45px; } From 93e7afd4b13727991ddf4f7250074c9ffb60c1b6 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Wed, 8 Jun 2011 18:00:26 -0400 Subject: [PATCH 14/14] make sure nested collapsible sets don't toggle their parent collapsibles when expanded. Fixes #1387 --- js/jquery.mobile.collapsible.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/js/jquery.mobile.collapsible.js b/js/jquery.mobile.collapsible.js index 0b77ead9..a812d6c9 100644 --- a/js/jquery.mobile.collapsible.js +++ b/js/jquery.mobile.collapsible.js @@ -72,7 +72,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, { //events collapsibleContain .bind( "collapse", function( event ){ - if( !event.isDefaultPrevented() ){ + if( !event.isDefaultPrevented() && $( event.target ).closest( ".ui-collapsible-contain" ).is( collapsibleContain ) ){ event.preventDefault(); collapsibleHeading .addClass( "ui-collapsible-heading-collapsed" ) @@ -89,7 +89,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, { } } ) - .bind( "expand", function( event ){ + .bind( "expand", function( event ){ if( !event.isDefaultPrevented() ){ event.preventDefault(); collapsibleHeading @@ -114,14 +114,16 @@ $.widget( "mobile.collapsible", $.mobile.widget, { collapsibleParent .jqmData( "collapsiblebound", true ) .bind( "expand", function( event ){ - $( this ).find( ".ui-collapsible-contain" ) - .not( $( event.target ).closest( ".ui-collapsible-contain" ) ) - .not( "> .ui-collapsible-contain .ui-collapsible-contain" ) + + $( event.target ) + .closest( ".ui-collapsible-contain" ) + .siblings( ".ui-collapsible-contain" ) .trigger( "collapse" ); + } ); - var set = collapsibleParent.find( ":jqmData(role=collapsible )" ); + var set = collapsibleParent.find( ":jqmData(role=collapsible ):first" ); set.first() .find( "a:eq(0)" )