From f159943f2359ce828aaa2a920943a3a4a20f6d37 Mon Sep 17 00:00:00 2001 From: Youmin Ha Date: Thu, 24 Jan 2013 15:55:07 +0900 Subject: [PATCH] JQM: Trim text in listitem to get index in autodivider JQM autodivider uses $(li).text().slice(0,1) to get index of each listitem, but it may have whitespaces in the beginning and end. This patch trims those whitespaces from the text. Change-Id: Id0cefd8413c91daeb1f2291164db8696ae1dad6e --- ...xt-in-listitem-to-get-index-in-autodivide.patch | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 libs/patch/0028-JQM-Trim-text-in-listitem-to-get-index-in-autodivide.patch diff --git a/libs/patch/0028-JQM-Trim-text-in-listitem-to-get-index-in-autodivide.patch b/libs/patch/0028-JQM-Trim-text-in-listitem-to-get-index-in-autodivide.patch new file mode 100644 index 0000000..1d6dac0 --- /dev/null +++ b/libs/patch/0028-JQM-Trim-text-in-listitem-to-get-index-in-autodivide.patch @@ -0,0 +1,30 @@ +From b3120cd2bf164dbcb4ee47fe9a5c7b2c945dd494 Mon Sep 17 00:00:00 2001 +From: Youmin Ha +Date: Thu, 24 Jan 2013 15:51:17 +0900 +Subject: [PATCH] JQM: Trim text in listitem to get index in autodivider + +JQM autodivider uses $(li).text().slice(0,1) to get index of each +listitem, but it may have whitespaces in the beginning and +end. This patch trims those whitespaces from the text. + +Signed-off-by: Youmin Ha +--- + .../js/widgets/listview.autodividers.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.autodividers.js b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.autodividers.js +index f0c228c..4d947b4 100644 +--- a/libs/js/jquery-mobile-1.2.0/js/widgets/listview.autodividers.js ++++ b/libs/js/jquery-mobile-1.2.0/js/widgets/listview.autodividers.js +@@ -16,7 +16,7 @@ $.mobile.listview.prototype.options.autodividersSelector = function( elt ) { + } + + // create the text for the divider (first uppercased letter) +- text = text.slice( 0, 1 ).toUpperCase(); ++ text = text.trim().slice( 0, 1 ).toUpperCase(); + + return text; + }; +-- +1.7.9.5 + -- 2.7.4