Permalink
Browse files

Selectmenu: Correctly pass theme and overlayTheme to popup

Closes gh-7196
Fixes gh-7195
  • Loading branch information...
gabrielschulhof committed Feb 28, 2014
1 parent 9ff610d commit 4434822486adb5e28e44f59e44daa8b42f3501d1
Showing with 11 additions and 5 deletions.
  1. +4 −1 js/widgets/forms/select.custom.js
  2. +2 −2 tests/unit/select/index.html
  3. +5 −2 tests/unit/select/select_core.js
@@ -162,7 +162,10 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, {
"</div>"+
"<div data-" + $.mobile.ns + "role='content'></div>"+
"</div>" );
listbox = $( "<div id='" + popupId + "' class='ui-selectmenu'></div>" ).insertAfter( this.select ).popup({ theme: o.overlayTheme });
listbox = $( "<div" + themeAttr + overlayThemeAttr + " id='" + popupId +
"' class='ui-selectmenu'></div>" )
.insertAfter( this.select )
.popup();
list = $( "<ul class='ui-selectmenu-list' id='" + menuId + "' role='listbox' aria-labelledby='" + this.buttonId + "'" + themeAttr + dividerThemeAttr + "></ul>" ).appendTo( listbox );
header = $( "<div class='ui-header ui-bar-" + ( o.theme ? o.theme : "inherit" ) + "'></div>" ).prependTo( listbox );
headerTitle = $( "<h1 class='ui-title'></h1>" ).appendTo( header );
@@ -34,8 +34,8 @@
<div data-nstest-role="page">
<div data-nstest-role="content">
<div data-role="fieldcontain">
<label for="role-test">Multiple:</label>
<select name="role-test" id="role-test" multiple="multiple" data-nstest-native-menu="false">
<label for="enhance-test">Multiple:</label>
<select name="enhance-test" id="enhance-test" multiple="multiple" data-nstest-native-menu="false" data-nstest-overlay-theme="b" data-nstest-theme="x">
<option>Choose options</option>
<option value="1">The 1st Option</option>
<option value="2" selected="selected">The 2nd Option</option>
@@ -7,13 +7,16 @@
module( "Custom select" );
test( "Custom select is enhanced correctly", function() {
deepEqual( $( "#role-test-listbox a:first" ).attr( "role" ), "button", "The close button for a multiple choice select popup has the " + '"' + "role='button'" + '"' + " set" );
var popup = $( "#enhance-test-listbox" );
deepEqual( $( "#enhance-test-listbox a:first" ).attr( "role" ), "button", "The close button for a multiple choice select popup has the " + '"' + "role='button'" + '"' + " set" );
deepEqual( popup.popup( "option", "overlayTheme" ), "b", "Popup has overlayTheme b" );
deepEqual( popup.popup( "option", "theme" ), "x", "Popup has theme x" );
});
module( "Native select" );
test( "Select menu ID", function() {
ok( $( ".no-id-test" ).closest( ".ui-btn" ).attr( "id" ) !== "undefined-button", "Select menu without an ID does not result in the button having name 'undefined-button'" );
});
})(jQuery);

0 comments on commit 4434822

Please sign in to comment.