Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Listview: added check for existing list when adding nested lists. Fixed #5098 dynamic Nested lists with same parent text resolve to the same sub-page #5106

Closed
wants to merge 1 commit into from

2 participants

@alzoid

...#5098 dynamic Nested lists with same parent text resolve to the sam

Listview: added check for existing list when adding nested lists. Fixed
#5098 dynamic Nested lists with same parent text resolve to the same
sub-page

@alzoid alzoid Listview: added check for exisintg list when adding nested lists. Fixed
#5098 dynamic Nested lists with same parent text resolve to the sam

Listview: added check for exisintg list when adding nested lists. Fixed
#5098 dynamic Nested lists with same parent text resolve to the same
sub-page
6c4acb7
@jaspermdegroot
Collaborator

@alzoid

Thanks for submitting the PR!

We decided to deprecate the nested listview feature. See #5657.
#5098 has been closed as won't fix, so I am closing this PR as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 28, 2012
  1. @alzoid

    Listview: added check for exisintg list when adding nested lists. Fixed

    alzoid authored
    #5098 dynamic Nested lists with same parent text resolve to the sam
    
    Listview: added check for exisintg list when adding nested lists. Fixed
    #5098 dynamic Nested lists with same parent text resolve to the same
    sub-page
This page is out of date. Refresh to see the latest.
Showing with 29 additions and 2 deletions.
  1. +22 −0 .gitattributes
  2. +7 −2 js/widgets/listview.js
View
22 .gitattributes
@@ -0,0 +1,22 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# Custom for Visual Studio
+*.cs diff=csharp
+*.sln merge=union
+*.csproj merge=union
+*.vbproj merge=union
+*.fsproj merge=union
+*.dbproj merge=union
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
View
9 js/widgets/listview.js
@@ -356,7 +356,12 @@ $.widget( "mobile.listview", $.mobile.widget, {
dns = "data-" + $.mobile.ns,
self = this,
persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),
- hasSubPages;
+ hasSubPages,
+ listToRenderLength,
+ currentListLength;
+
+ listToRenderLength = parentList.find( "li>ul, li>ol" ).toArray().length;
+ currentListLength = $( parentList ).children("li").length;
if ( typeof listCountPerPage[ parentId ] === "undefined" ) {
listCountPerPage[ parentId ] = -1;
@@ -367,7 +372,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
$( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function( i ) {
var self = this,
list = $( this ),
- listId = list.attr( "id" ) || parentListId + "-" + i,
+ listId = list.attr( "id" ) || parentListId + "-" + ( listToRenderLength < currentListLength ? currentListLength-listToRenderLength : i ),
parent = list.parent(),
nodeElsFull = $( list.prevAll().toArray().reverse() ),
nodeEls = nodeElsFull.length ? nodeElsFull : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" ),
Something went wrong with that request. Please try again.