2010-09-10 22:23:13 +00:00
|
|
|
/*
|
|
|
|
|
* jQuery Mobile Framework : sample plugin for making button links that proxy to native input/buttons
|
|
|
|
|
* Copyright (c) jQuery Project
|
|
|
|
|
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
|
|
|
|
|
* Note: Code is in draft form and is subject to change
|
|
|
|
|
*/
|
|
|
|
|
(function($){
|
|
|
|
|
$.fn.customButton = function(){
|
|
|
|
|
return $(this).each(function(){
|
|
|
|
|
var button = $(this).addClass('ui-btn-hidden').attr('tabindex','-1');
|
2010-10-11 01:17:49 +00:00
|
|
|
//add ARIA role
|
2010-09-10 22:23:13 +00:00
|
|
|
$('<a href="#" role="button">'+ (button.text() || button.val()) +'</a>')
|
2010-10-11 19:47:30 +00:00
|
|
|
.buttonMarkup({
|
|
|
|
|
theme: button.data('theme'),
|
|
|
|
|
icon: button.data('icon'),
|
|
|
|
|
iconpos: button.data('iconpos'),
|
|
|
|
|
inline: button.data('inline')
|
|
|
|
|
})
|
2010-09-10 22:23:13 +00:00
|
|
|
.click(function(){
|
|
|
|
|
button.click();
|
|
|
|
|
return false;
|
|
|
|
|
})
|
|
|
|
|
.insertBefore(button);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
})(jQuery);
|