/* * jQuery Mobile Framework : "customSelect" plugin (based on code from Filament Group,Inc) * 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 ( $ ) { $.widget( "mobile.selectmenu", $.mobile.widget, { options: { theme: undefined }, _create: function(){ var select = this.element .attr( "tabindex", "-1" ) .wrap( "
" ), selectID = select.attr( "id" ), label = $( "label[for="+ selectID +"]" ) .addClass( "ui-select" ), chooseText = label.text(), buttonId = selectID + "-button", menuId = selectID + "-menu", thisPage = select.closest( ".ui-page" ), menuType, currScroll, button = $( "", { "href": "#", "role": "button", "id": buttonId, "aria-haspopup": "true", "aria-owns": menuId }) .text( $( select[0].options.item(select[0].selectedIndex) ).text() ) .insertBefore( select ) .buttonMarkup({ iconpos: 'right', icon: 'arrow-d', theme: this.options.theme }), menuPage = $( "
" + "
" + "
" + chooseText + "
"+ "
"+ "
"+ "
" ) .appendTo( $.pageContainer ) .page(), menuPageContent = menuPage.find( ".ui-content" ), screen = $( "
", { "class": "ui-listbox-screen ui-overlay ui-screen-hidden fade" }) .appendTo( thisPage ), listbox = $( "
", { "class": "ui-listbox ui-listbox-hidden ui-body-a ui-overlay-shadow ui-corner-all pop"} ) .insertAfter(screen), list = $( "