Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

split list icons should prefer second link, list item, and then the w…

…hole list config Fixes #3775
  • Loading branch information...
commit 30a8322bfe7c9aada99745c579039fed37fb758f 1 parent 054b9a4
@johnbender johnbender authored
View
6 js/jquery.mobile.listview.js
@@ -158,7 +158,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,
itemClassDict = {},
item, itemClass, itemTheme,
- a, last, splittheme, countParent, icon, imgParents, img;
+ a, last, splittheme, countParent, icon, imgParents, img, linkIcon;
if ( counter ) {
$list.find( ".ui-li-dec" ).remove();
@@ -200,6 +200,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
last = a.last();
splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;
+ linkIcon = last.jqmData("icon");
last.appendTo(item)
.attr( "title", last.getEncodedText() )
@@ -219,7 +220,8 @@ $.widget( "mobile.listview", $.mobile.widget, {
corners: true,
theme: splittheme,
iconpos: "notext",
- icon: icon || listspliticon || o.splitIcon
+ // link icon overrides list item icon overrides ul element overrides options
+ icon: linkIcon || icon || listspliticon || o.splitIcon
})
);
}
View
5 tests/unit/listview/index.html
@@ -350,13 +350,14 @@ <h2 id="qunit-userAgent"></h2>
<div data-nstest-role="page" id="split-list-icon">
<div data-nstest-role="content">
- <ul data-nstest-role="listview">
+ <ul data-nstest-role="listview" data-nstest-split-icon="delete">
<li data-nstest-icon="star"><a href="#">Star</a><a href="#">Star</a></li>
<li data-nstest-icon="plug"><a href="#">Plus</a><a href="#">Plus</a></li>
<li><a href="#">Default</a><a href="#">Default</a></li>
+ <!-- respect the child element icon -->
+ <li data-nstest-icon="star"><a href="#">Default</a><a data-nstest-icon="plug" href="#">Default</a></li>
</ul>
</div>
</div>
-
</body>
</html>
View
6 tests/unit/listview/listview_core.js
@@ -842,10 +842,9 @@
function() {
$.mobile.activePage.find("li").each(function(i, elem){
var $elem = $(elem),
- icon = $elem.jqmData( "icon" ),
- order = [ "star", "plug", "arrow-r" ];
+ order = [ "star", "plug", "delete", "plug" ];
- same( $elem.find("span.ui-icon-" + order[i]).length, 1, "there should be one " + icon + " icon" );
+ same( $elem.find("span.ui-icon-" + order[i]).length, 1, "there should be one " + order[i] + " icon" );
});
window.history.back();
@@ -854,5 +853,4 @@
start
]);
});
-
})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.