Skip to content

Commit aae9205

Browse files
committed
Fixes jquery-archive#3283: Enforce options type and prevent multiple enhancement
1 parent 3356899 commit aae9205

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

js/jquery.mobile.buttonMarkup.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.vmouse" ], function
77
( function( $, undefined ) {
88

99
$.fn.buttonMarkup = function( options ) {
10-
var $workingSet = this;
10+
var self = this,
11+
$workingSet = this.filter( function( i, el ) {
12+
return !self.eq( i ).hasClass( "ui-btn" );
13+
});
1114

1215
// trim the working set when ignoring content is switched on
1316
if( $.mobile.ignoreContentEnabled ){
1417
$workingSet = $.mobile.enhanceable( $workingSet );
1518
}
1619

17-
options = options || {};
20+
// Enforce options to be of type string
21+
options = ( options && ( $.type( options ) == "object" ) )? options : {};
1822
for ( var i = 0; i < $workingSet.length; i++ ) {
1923
var el = $workingSet.eq( i ),
2024
e = el[ 0 ],

0 commit comments

Comments
 (0)