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.
This commit is contained in:
jblas@adobe.com 2011-11-01 09:26:41 -07:00
parent 11dbc5771b
commit ebd7e04ce0
2 changed files with 8 additions and 8 deletions

View file

@ -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

View file

@ -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()