From a0596434bc4ed0581733b2c13169a00a4cb29ad2 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Fri, 19 Nov 2010 23:21:16 -0500 Subject: [PATCH] moved the ID creation string escape function from core to listview. No other plugins use it. --- js/jquery.mobile.listview.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index c9b6f1ac..6ed95f3c 100644 --- a/js/jquery.mobile.listview.js +++ b/js/jquery.mobile.listview.js @@ -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( "
" )