diff --git a/docs/api/data-attributes.html b/docs/api/data-attributes.html index 71e70dd2454..5b3eb8b629b 100644 --- a/docs/api/data-attributes.html +++ b/docs/api/data-attributes.html @@ -388,6 +388,10 @@

Listview

data-header-theme swatch letter (a-z) + + data-icon + home | delete | plus | arrow-u | arrow-d | check | gear | grid | star | custom | arrow-r | arrow-l | minus | refresh | forward | back | alert | info | search | false + data-inset true | false diff --git a/docs/lists/lists-options.html b/docs/lists/lists-options.html index bd228e69793..6b2facbf39a 100644 --- a/docs/lists/lists-options.html +++ b/docs/lists/lists-options.html @@ -114,6 +114,17 @@

Listviews

This option is also exposed as a data attribute: data-header-theme="a".

+
icon string
+
+

default: "arrow-r"

+

Applies an icon from the icon set to all linked list buttons. To set the value for all instances of this widget, bind this option to the mobileinit event:

+
$( document ).bind( "mobileinit", function(){
+    $.mobile.listview.prototype.options.icon = "star";
+});
+
+

This option is also exposed as a data attribute: data-icon="star".

+
+
initSelector CSS selector string

default: ":jqmData(role='listview')"

diff --git a/js/widgets/listview.js b/js/widgets/listview.js index f24699bae83..8d432ca3d28 100644 --- a/js/widgets/listview.js +++ b/js/widgets/listview.js @@ -21,6 +21,7 @@ $.widget( "mobile.listview", $.mobile.widget, { countTheme: "c", headerTheme: "b", dividerTheme: "b", + icon: "arrow-r", splitIcon: "arrow-r", splitTheme: "b", inset: false, @@ -163,6 +164,7 @@ $.widget( "mobile.listview", $.mobile.widget, { dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme, listsplittheme = $list.jqmData( "splittheme" ), listspliticon = $list.jqmData( "spliticon" ), + listicon = $list.jqmData( "icon" ), li = this._getChildrenByTagName( $list[ 0 ], "li", "LI" ), ol = !!$.nodeName( $list[ 0 ], "ol" ), jsCount = !$.support.cssPseudoElement, @@ -211,7 +213,7 @@ $.widget( "mobile.listview", $.mobile.widget, { shadow: false, corners: false, iconpos: "right", - icon: a.length > 1 || icon === false ? false : icon || "arrow-r", + icon: a.length > 1 || icon === false ? false : icon || listicon || o.icon, theme: itemTheme });