mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-23 01:10:25 +00:00
moved the ID creation string escape function from core to listview. No other plugins use it.
This commit is contained in:
parent
ba5fea7f1e
commit
a0596434bc
1 changed files with 6 additions and 1 deletions
|
|
@ -279,6 +279,11 @@ $.widget( "mobile.listview", $.mobile.widget, {
|
|||
});
|
||||
},
|
||||
|
||||
//create a string for ID/subpage url creation
|
||||
_idStringEscape: function( str ){
|
||||
return str.replace(/[^a-zA-Z0-9]/g, '-');
|
||||
},
|
||||
|
||||
_createSubPages: function() {
|
||||
var parentList = this.element,
|
||||
parentPage = parentList.closest( ".ui-page" ),
|
||||
|
|
@ -290,7 +295,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
|
|||
var list = $( this ),
|
||||
parent = list.parent(),
|
||||
title = parent.contents()[ 0 ].nodeValue.split("\n")[0],
|
||||
id = parentId + "&" + $.mobile.subPageUrlKey + "=" + $.mobile.idStringEscape(title + " " + i),
|
||||
id = parentId + "&" + $.mobile.subPageUrlKey + "=" + self.idStringEscape(title + " " + i),
|
||||
theme = list.data( "theme" ) || o.theme,
|
||||
countTheme = list.data( "counttheme" ) || parentList.data( "counttheme" ) || o.countTheme,
|
||||
newPage = list.wrap( "<div data-role='page'><div data-role='content'></div></div>" )
|
||||
|
|
|
|||
Loading…
Reference in a new issue