Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Merge branch 'MauriceG-patch-8'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbender committed Oct 18, 2011
2 parents cc20cf9 + 911ff69 commit 0c5d279
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
1 change: 1 addition & 0 deletions js/jquery.mobile.forms.select.custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@

self.menuType = "page";
self.menuPageContent.append( self.list );
self.menuPage.find("div .ui-title").text(self.label.text());
$.mobile.changePage( self.menuPage, {
transition: $.mobile.defaultDialogTransition
});
Expand Down
45 changes: 43 additions & 2 deletions tests/unit/select/select_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,49 @@

$.mobile.page.prototype.options.keepNative = "select.should-be-native";

// not testing the positive case here since's it's obviously tested elsewhere
// not testing the positive case here since's it's obviously tested elsewhere
test( "select elements in the keepNative set shouldn't be enhanced", function() {
ok( !$("#keep-native").parent().is("div.ui-btn") );
ok( !$("#keep-native").parent().is("div.ui-btn") );
});

asyncTest( "dialog size select title should match the label", function() {
var $select = $( "#select-choice-many-1" ),
$label = $select.parent().siblings( "label" ),
$button = $select.siblings( "a" );

$.testHelper.pageSequence([
function() {
$button.click();
},

function() {
same($.mobile.activePage.find( ".ui-title" ).text(), $label.text());
window.history.back();
},

start
]);
});

asyncTest( "dialog size select title should match the label when changed after the dialog markup is added to the DOM", function() {
var $select = $( "#select-choice-many-1" ),
$label = $select.parent().siblings( "label" ),
$button = $select.siblings( "a" );

$label.text( "foo" );

$.testHelper.pageSequence([
function() {
$label.text( "foo" );
$button.click();
},

function() {
same($.mobile.activePage.find( ".ui-title" ).text(), $label.text());
window.history.back();
},

start
]);
});
})(jQuery);

0 comments on commit 0c5d279

Please sign in to comment.