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} 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)" ) diff --git a/js/jquery.mobile.dialog.js b/js/jquery.mobile.dialog.js index 340311a0..922932d0 100644 --- a/js/jquery.mobile.dialog.js +++ b/js/jquery.mobile.dialog.js @@ -4,59 +4,51 @@ * 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(){ - var self = this, - $el = self.element; + _create: function() { + var $el = this.element; /* class the markup for dialog styling */ - this.element + $el //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; - if( e.type == "vclick" ){ - $targetel = $(e.target).closest("a"); - } - else{ - $targetel = $(e.target).closest("form"); - } + $el + .bind( "vclick submit", function( e ) { + var $target = $( e.target ).closest( e.type === "vclick" ? "a" : "form" ); - if( $targetel.length && !$targetel.jqmData("transition") ){ + if( $target.length && ! $target.jqmData( "transition" ) ) { var active = $.mobile.urlHistory.getActive() || {}; - $targetel - .attr("data-" + $.mobile.ns + "transition", ( active.transition || $.mobile.defaultDialogTransition ) ) - .attr("data-" + $.mobile.ns + "direction", "reverse"); + $target + .attr( "data-" + $.mobile.ns + "transition", ( active.transition || $.mobile.defaultDialogTransition ) ) + .attr( "data-" + $.mobile.ns + "direction", "reverse" ); } }); - }, //close method goes back in history - close: function(){ + close: function() { window.history.back(); } }); -})( jQuery ); \ No newline at end of file +})( jQuery ); diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index 9fd9a660..cd7600fb 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() 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 @@