Permalink
Browse files

Allows use of data-mini="true" on listviews themselves, as well as in…

…dividual items within a listview.
  • Loading branch information...
1 parent 8d0f08a commit 80f44568ea8e12ed082426a9ee34a0d5f9ce08ef @Wilto Wilto committed Mar 9, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 js/jquery.mobile.listview.js
View
12 js/jquery.mobile.listview.js
@@ -12,23 +12,29 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.buttonMarkup", ".
var listCountPerPage = {};
$.widget( "mobile.listview", $.mobile.widget, {
+
options: {
theme: null,
countTheme: "c",
headerTheme: "b",
dividerTheme: "b",
splitIcon: "arrow-r",
splitTheme: "b",
+ mini: false,
inset: false,
initSelector: ":jqmData(role='listview')"
},
_create: function() {
- var t = this;
-
+ var t = this,
+ listviewClasses = "";
+
+ listviewClasses += t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "";
+ listviewClasses += t.element.jqmData( "mini" ) || t.options.mini === true ? " ui-mini" : "";
+
// create listview markup
t.element.addClass(function( i, orig ) {
- return orig + " ui-listview " + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" );
+ return orig + " ui-listview " + listviewClasses;
});
t.refresh( true );

0 comments on commit 80f4456

Please sign in to comment.