Skip to content
This repository
Browse code

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

…dividual items within a listview.
  • Loading branch information...
commit 80f44568ea8e12ed082426a9ee34a0d5f9ce08ef 1 parent 8d0f08a
Mat Marquis authored March 09, 2012

Showing 1 changed file with 9 additions and 3 deletions. Show diff stats Hide diff stats

  1. 12  js/jquery.mobile.listview.js
12  js/jquery.mobile.listview.js
@@ -12,6 +12,7 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.buttonMarkup", ".
12 12
 var listCountPerPage = {};
13 13
 
14 14
 $.widget( "mobile.listview", $.mobile.widget, {
  15
+
15 16
 	options: {
16 17
 		theme: null,
17 18
 		countTheme: "c",
@@ -19,16 +20,21 @@ $.widget( "mobile.listview", $.mobile.widget, {
19 20
 		dividerTheme: "b",
20 21
 		splitIcon: "arrow-r",
21 22
 		splitTheme: "b",
  23
+		mini: false,
22 24
 		inset: false,
23 25
 		initSelector: ":jqmData(role='listview')"
24 26
 	},
25 27
 
26 28
 	_create: function() {
27  
-		var t = this;
28  
-
  29
+		var t = this,
  30
+			listviewClasses = "";
  31
+			
  32
+		listviewClasses += t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "";
  33
+		listviewClasses += t.element.jqmData( "mini" ) || t.options.mini === true ? " ui-mini" : "";
  34
+		
29 35
 		// create listview markup
30 36
 		t.element.addClass(function( i, orig ) {
31  
-			return orig + " ui-listview " + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" );
  37
+			return orig + " ui-listview " + listviewClasses;
32 38
 		});
33 39
 
34 40
 		t.refresh( true );

0 notes on commit 80f4456

Please sign in to comment.
Something went wrong with that request. Please try again.