Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@Wilto Wilto authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 js/jquery.mobile.listview.js
View
12 js/jquery.mobile.listview.js
@@ -12,6 +12,7 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.buttonMarkup", ".
var listCountPerPage = {};
$.widget( "mobile.listview", $.mobile.widget, {
+
options: {
theme: null,
countTheme: "c",
@@ -19,16 +20,21 @@ $.widget( "mobile.listview", $.mobile.widget, {
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 );
Please sign in to comment.
Something went wrong with that request. Please try again.