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 @@
This option is also exposed as a data attribute: data-header-theme="a"
.
icon
stringdefault: "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 stringdefault: ":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 });