Skip to content

Commit ebd7e04

Browse files
committed
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.
1 parent 11dbc57 commit ebd7e04

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

js/jquery.mobile.buttonMarkup.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ $.fn.buttonMarkup = function( options ) {
1313
var el = this.eq( i ),
1414
e = el[ 0 ],
1515
o = $.extend( {}, $.fn.buttonMarkup.defaults, {
16-
icon: options.icon || el.jqmData( "icon" ),
17-
iconpos: options.iconpos || el.jqmData( "iconpos" ),
18-
theme: options.theme || el.jqmData( "theme" ),
19-
inline: options.inline || el.jqmData( "inline" ),
20-
shadow: options.shadow || el.jqmData( "shadow" ),
21-
corners: options.corners || el.jqmData( "corners" ),
22-
iconshadow: options.iconshadow || el.jqmData( "iconshadow" )
16+
icon: options.icon !== undefined ? options.icon : el.jqmData( "icon" ),
17+
iconpos: options.iconpos !== undefined ? options.iconpos : el.jqmData( "iconpos" ),
18+
theme: options.theme !== undefined ? options.theme : el.jqmData( "theme" ),
19+
inline: options.inline !== undefined ? options.inline : el.jqmData( "inline" ),
20+
shadow: options.shadow !== undefined ? options.shadow : el.jqmData( "shadow" ),
21+
corners: options.corners !== undefined ? options.corners : el.jqmData( "corners" ),
22+
iconshadow: options.iconshadow !== undefined ? options.iconshadow : el.jqmData( "iconshadow" )
2323
}, options ),
2424

2525
// Classes Defined

js/jquery.mobile.listview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ $.widget( "mobile.listview", $.mobile.widget, {
3939
var $countli = item.find( ".ui-li-count" );
4040
if ( $countli.length ) {
4141
item.addClass( "ui-li-has-count" );
42+
$countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );
4243
}
43-
$countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );
4444

4545
// TODO class has to be defined in markup
4646
item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()

0 commit comments

Comments
 (0)