mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
fix for #3141 - redirect from button() and buttonMarkup() to correct function for element
This commit is contained in:
parent
2ba27e0adc
commit
c0dbecc855
2 changed files with 13 additions and 1 deletions
|
|
@ -30,6 +30,12 @@ $.fn.buttonMarkup = function( options ) {
|
|||
buttonText = document.createElement( o.wrapperEls ),
|
||||
buttonIcon = o.icon ? document.createElement( "span" ) : null;
|
||||
|
||||
// if this is a button, check if it's been enhanced and, if not, use the right function
|
||||
if( e.tagName === "BUTTON" ) {
|
||||
if ( !$( e.parentNode ).hasClass( "ui-btn" ) ) $( e ).button();
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( attachEvents ) {
|
||||
attachEvents();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,12 +19,18 @@ $.widget( "mobile.button", $.mobile.widget, {
|
|||
},
|
||||
_create: function() {
|
||||
var $el = this.element,
|
||||
$button,
|
||||
$button,
|
||||
o = this.options,
|
||||
type,
|
||||
name,
|
||||
$buttonPlaceholder;
|
||||
|
||||
// if this is a link, check if it's been enhanced and, if not, use the right function
|
||||
if( $el[ 0 ].tagName === "A" ) {
|
||||
if ( !$el.hasClass( "ui-btn" ) ) $el.buttonMarkup();
|
||||
return;
|
||||
}
|
||||
|
||||
// Add ARIA role
|
||||
this.button = $( "<div></div>" )
|
||||
.text( $el.text() || $el.val() )
|
||||
|
|
|
|||
Loading…
Reference in a new issue