From 212eb30cf0cb14aeeb2c360796ef5c64ca0d0cf0 Mon Sep 17 00:00:00 2001
From: Ray Ling
Date: Wed, 6 Apr 2011 19:44:52 +0800
Subject: [PATCH 1/3] add dynamicInsetList.html
---
tests/functional/dynamicInsetList.html | 54 ++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 tests/functional/dynamicInsetList.html
diff --git a/tests/functional/dynamicInsetList.html b/tests/functional/dynamicInsetList.html
new file mode 100644
index 00000000000..d2cd5ddbc7f
--- /dev/null
+++ b/tests/functional/dynamicInsetList.html
@@ -0,0 +1,54 @@
+
+
+
+
+ jQuery Mobile: Grid Layout
+
+
+
+
+
+
+
+
+
+
+
Dynamic Inset List
+
+
+
+
Touch events on this page will log out below, prepending to the top as they arrive.
+
+
Option *.5s are dynamicly inserted when 'pagebeforeshow' event invoked. Click options to remove it.
+
+
+
+
+
+
+
+
+
From 3647830c1998a9ee5b0d9dee58e9773c50868494 Mon Sep 17 00:00:00 2001
From: Ray Ling
Date: Wed, 6 Apr 2011 22:50:18 +0800
Subject: [PATCH 2/3] 1. add thumbnail list test 2. add thumbnail class to
'item' parameter of _itemApply, instead of using 'li' selector
---
js/jquery.mobile.listview.js | 4 +--
tests/functional/dynamicInsetList.html | 35 ++++++++++++++++++--------
2 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js
index c516dbf01fe..9bfbbca0be1 100644
--- a/js/jquery.mobile.listview.js
+++ b/js/jquery.mobile.listview.js
@@ -29,7 +29,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
$list.addClass( "ui-listview-inset ui-corner-all ui-shadow" );
}
- this._itemApply( $list, $list );
+ this._itemApply( $list, $list.find("li") );
this.refresh( true );
@@ -44,7 +44,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
item.find( "p, dl" ).addClass( "ui-li-desc" );
- $list.find( "li" ).find( ">img:eq(0), >:first>img:eq(0)" ).addClass( "ui-li-thumb" ).each(function() {
+ item.find( "img:eq(0)" ).addClass( "ui-li-thumb" ).each(function() {
$( this ).closest( "li" ).addClass( $(this).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
});
diff --git a/tests/functional/dynamicInsetList.html b/tests/functional/dynamicInsetList.html
index d2cd5ddbc7f..ecf515fd864 100644
--- a/tests/functional/dynamicInsetList.html
+++ b/tests/functional/dynamicInsetList.html
@@ -10,12 +10,15 @@
$('#jqm-home').live('pagebeforeshow', function(event, ui){
- tpl = 'Option %s';
+ tpl = '';
+ tpl += '
';
+ tpl += 'Option %s
';
+ tpl += 'Option %s
';
- $('#test').prepend(tpl.replace(/%s/g, '0.5'));
- $('#option2').before(tpl.replace(/%s/g, '1.5'));
- $('#option2').after(tpl.replace(/%s/g, '2.5'));
- $('#test').append(tpl.replace(/%s/g, '3.5'));
+ $('#test').prepend(tpl.replace(/%s/g, '0.5').replace(/%img/g, 'album-bb.jpg'));
+ $('#option2').before(tpl.replace(/%s/g, '1.5').replace(/%img/g, 'album-p.jpg'));
+ $('#option2').after(tpl.replace(/%s/g, '2.5').replace(/%img/g, 'album-ws.jpg'));
+ $('#test').append(tpl.replace(/%s/g, '3.5').replace(/%img/g, 'album-xx.jpg'));
$('#test').listview("refresh");
$("li[id!='option2']").bind("tap click", function(e){
@@ -38,11 +41,23 @@ Dynamic Inset List
Option *.5s are dynamicly inserted when 'pagebeforeshow' event invoked. Click options to remove it.
-
+
From 1c1030a7113e419798ca82dbc3a0f4b1dbd4a9a1 Mon Sep 17 00:00:00 2001
From: Ray Ling
Date: Thu, 7 Apr 2011 08:59:55 +0800
Subject: [PATCH 3/3] remove test code
---
tests/functional/dynamicInsetList.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/functional/dynamicInsetList.html b/tests/functional/dynamicInsetList.html
index ecf515fd864..e606233f28b 100644
--- a/tests/functional/dynamicInsetList.html
+++ b/tests/functional/dynamicInsetList.html
@@ -21,7 +21,7 @@
$('#test').append(tpl.replace(/%s/g, '3.5').replace(/%img/g, 'album-xx.jpg'));
$('#test').listview("refresh");
- $("li[id!='option2']").bind("tap click", function(e){
+ $("li").bind("tap click", function(e){
$(this).remove();
$("#log")
.prepend("- "+ e.type +" event; target: "+ e.target.nodeName +"; message: grid '"+$(this).text()+"' hidden
")