From 5803aa19afb3eaf7ce0717dd40bc7ef69748aa27 Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Fri, 28 Feb 2014 19:56:09 +0200 Subject: [PATCH 1/2] Selectmenu: Correctly pass theme and overlayTheme to popup Fixes gh-7195 --- js/widgets/forms/select.custom.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/widgets/forms/select.custom.js b/js/widgets/forms/select.custom.js index adb2dc1a985..c9b40dad27c 100644 --- a/js/widgets/forms/select.custom.js +++ b/js/widgets/forms/select.custom.js @@ -162,7 +162,10 @@ $.widget( "mobile.selectmenu", $.mobile.selectmenu, { ""+ "
"+ "" ); - listbox = $( "
" ).insertAfter( this.select ).popup({ theme: o.overlayTheme }); + listbox = $( "" ) + .insertAfter( this.select ) + .popup(); list = $( "" ).appendTo( listbox ); header = $( "
" ).prependTo( listbox ); headerTitle = $( "

" ).appendTo( header ); From f8e150c7fc480e9446b62a58d4e0a29d1251101a Mon Sep 17 00:00:00 2001 From: Gabriel Schulhof Date: Fri, 28 Feb 2014 19:59:49 +0200 Subject: [PATCH 2/2] Selectmenu: Test proper theme option propagation for non-native --- tests/unit/select/index.html | 4 ++-- tests/unit/select/select_core.js | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/unit/select/index.html b/tests/unit/select/index.html index 0d7b2db7640..47901c725c6 100644 --- a/tests/unit/select/index.html +++ b/tests/unit/select/index.html @@ -34,8 +34,8 @@
- - diff --git a/tests/unit/select/select_core.js b/tests/unit/select/select_core.js index 80c2b4af956..7a0b2306773 100644 --- a/tests/unit/select/select_core.js +++ b/tests/unit/select/select_core.js @@ -7,7 +7,11 @@ 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" ); @@ -15,5 +19,4 @@ 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);