groupingtheme option is now exposed as data-groupingtheme. This should probably be renamed to "dividertheme", but for now, this Fixes #128, Fixes #134 (duplicate bugs)

This commit is contained in:
scottjehl 2010-10-10 18:17:26 -04:00
parent edaa43c479
commit 734e21816a
2 changed files with 6 additions and 4 deletions

View file

@ -66,7 +66,7 @@
</li>
</ul>
<ul data-role="listview" data-inset="true" data-theme="e">
<ul data-role="listview" data-inset="true" data-theme="e" data-groupingtheme="a">
<li data-role="list-divider">A</li>
<li><a href="index.html">Adam Kinkaid</a></li>
<li><a href="index.html">Alex Wickerham</a></li>

View file

@ -17,7 +17,8 @@ $.widget( "mobile.listview", $.mobile.widget, {
},
_create: function() {
var o = this.options;
var o = this.options
$list = this.element;
this._createSubPages();
@ -27,7 +28,8 @@ $.widget( "mobile.listview", $.mobile.widget, {
.find( "li" )
.each(function() {
var $li = $( this ),
role = $li.data( "role" );
role = $li.data( "role" ),
groupingtheme = $list.data( "groupingtheme" ) || o.groupingTheme;
if ( $li.is( ":has(img)" ) ) {
$li.addClass( "ui-li-has-thumb" );
}
@ -51,7 +53,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
.addClass( "ui-link-inherit" );
}
else if( role == "list-divider" ){
$li.addClass( "ui-li-grouping ui-btn ui-body-" + o.groupingTheme ).attr( "role", "heading" );
$li.addClass( "ui-li-grouping ui-btn ui-body-" + groupingtheme ).attr( "role", "heading" );
}
else {
$li.addClass( "ui-li-static ui-btn-up-" + o.theme );