Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Allows use of data-mini="true" on listviews themselves, as well as in…
Browse files Browse the repository at this point in the history
…dividual items within a listview.
  • Loading branch information
Wilto committed Mar 9, 2012
1 parent 8d0f08a commit 80f4456
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions js/jquery.mobile.listview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 80f4456

Please sign in to comment.