Permalink
Browse files

More enhancement optimizations:

- Modified buttonMarkup so that it checks options against undefined before calling jqmData(). This is necessary because false is a valid option.

- Modified listview so that it doesn't check for a data-counttheme unless it actually has a count item.
  • Loading branch information...
1 parent 11dbc57 commit ebd7e04ce05ca28e907bf0a3d10e8ac2a45be70c @jblas jblas committed Nov 1, 2011
Showing with 8 additions and 8 deletions.
  1. +7 −7 js/jquery.mobile.buttonMarkup.js
  2. +1 −1 js/jquery.mobile.listview.js
@@ -13,13 +13,13 @@ $.fn.buttonMarkup = function( options ) {
var el = this.eq( i ),
e = el[ 0 ],
o = $.extend( {}, $.fn.buttonMarkup.defaults, {
- icon: options.icon || el.jqmData( "icon" ),
- iconpos: options.iconpos || el.jqmData( "iconpos" ),
- theme: options.theme || el.jqmData( "theme" ),
- inline: options.inline || el.jqmData( "inline" ),
- shadow: options.shadow || el.jqmData( "shadow" ),
- corners: options.corners || el.jqmData( "corners" ),
- iconshadow: options.iconshadow || el.jqmData( "iconshadow" )
+ icon: options.icon !== undefined ? options.icon : el.jqmData( "icon" ),
+ iconpos: options.iconpos !== undefined ? options.iconpos : el.jqmData( "iconpos" ),
+ theme: options.theme !== undefined ? options.theme : el.jqmData( "theme" ),
+ inline: options.inline !== undefined ? options.inline : el.jqmData( "inline" ),
+ shadow: options.shadow !== undefined ? options.shadow : el.jqmData( "shadow" ),
+ corners: options.corners !== undefined ? options.corners : el.jqmData( "corners" ),
+ iconshadow: options.iconshadow !== undefined ? options.iconshadow : el.jqmData( "iconshadow" )
}, options ),
// Classes Defined
@@ -39,8 +39,8 @@ $.widget( "mobile.listview", $.mobile.widget, {
var $countli = item.find( ".ui-li-count" );
if ( $countli.length ) {
item.addClass( "ui-li-has-count" );
+ $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );
}
- $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );
// TODO class has to be defined in markup
item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()

0 comments on commit ebd7e04

Please sign in to comment.