From e38a58ab5410791f0d81853362943fdd971fa517 Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Wed, 25 May 2011 11:00:20 -0700 Subject: [PATCH 1/4] Issue #1338 Fixed CSS --- themes/default/jquery.mobile.forms.select.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/themes/default/jquery.mobile.forms.select.css b/themes/default/jquery.mobile.forms.select.css index b2231b41..0cec46cc 100644 --- a/themes/default/jquery.mobile.forms.select.css +++ b/themes/default/jquery.mobile.forms.select.css @@ -16,8 +16,7 @@ label.ui-select { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; } /*listbox*/ -.ui-select .ui-btn-text, .ui-selectmenu .ui-btn-text { display: inline-block; min-height: 1em; } -.ui-select .ui-btn-text { text-overflow: ellipsis; overflow: hidden; display: block;} +.ui-select .ui-btn-text, .ui-selectmenu .ui-btn-text { text-overflow: ellipsis; overflow: hidden; display: block; min-height: 1em; } .ui-selectmenu { position: absolute; padding: 0; z-index: 100 !important; width: 80%; max-width: 350px; padding: 6px; } .ui-selectmenu .ui-listview { margin: 0; } From 0012657761c9e9c53bbced763c66993bc403370d Mon Sep 17 00:00:00 2001 From: Kin Blas Date: Wed, 25 May 2011 12:44:10 -0700 Subject: [PATCH 2/4] Fix for issue 1708 - nightbuild close dialog throwing error - Check the returned active object to see if it is valid before attempting to extract the transition out of it. Default to $.mobile.defaultDialogTransition if there is no active object. --- js/jquery.mobile.dialog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/jquery.mobile.dialog.js b/js/jquery.mobile.dialog.js index 012d036e..fe0776d5 100644 --- a/js/jquery.mobile.dialog.js +++ b/js/jquery.mobile.dialog.js @@ -45,8 +45,9 @@ $.widget( "mobile.dialog", $.mobile.widget, { } if( $targetel.length && !$targetel.jqmData("transition") ){ + var active = $.mobile.urlHistory.getActive(); $targetel - .attr("data-" + $.mobile.ns + "transition", $.mobile.urlHistory.getActive().transition ) + .attr("data-" + $.mobile.ns + "transition", ( active ? active.transition : $.mobile.defaultDialogTransition ) ) .attr("data-" + $.mobile.ns + "direction", "reverse"); } }); From 37a180a6c515aeede4fe733394674c28246c1c64 Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Wed, 25 May 2011 13:06:43 -0700 Subject: [PATCH 3/4] Issue #1338 Smaller CSS fix --- themes/default/jquery.mobile.forms.select.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/default/jquery.mobile.forms.select.css b/themes/default/jquery.mobile.forms.select.css index 0cec46cc..d89defd3 100644 --- a/themes/default/jquery.mobile.forms.select.css +++ b/themes/default/jquery.mobile.forms.select.css @@ -16,7 +16,8 @@ label.ui-select { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; } /*listbox*/ -.ui-select .ui-btn-text, .ui-selectmenu .ui-btn-text { text-overflow: ellipsis; overflow: hidden; display: block; min-height: 1em; } +.ui-select .ui-btn-text, .ui-selectmenu .ui-btn-text { display: block; min-height: 1em; } +.ui-select .ui-btn-text { text-overflow: ellipsis; overflow: hidden;} .ui-selectmenu { position: absolute; padding: 0; z-index: 100 !important; width: 80%; max-width: 350px; padding: 6px; } .ui-selectmenu .ui-listview { margin: 0; } From ed7eb38bdca59a00febf2c3eee6a13f9521dd94b Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Wed, 25 May 2011 13:09:27 -0700 Subject: [PATCH 4/4] Issue #1338 Added unit test --- tests/unit/select/index.html | 7 +++++++ tests/unit/select/select_core.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/tests/unit/select/index.html b/tests/unit/select/index.html index 7e21c235..0c9da49f 100644 --- a/tests/unit/select/index.html +++ b/tests/unit/select/index.html @@ -239,6 +239,13 @@ + +
+ +
diff --git a/tests/unit/select/select_core.js b/tests/unit/select/select_core.js index cc9d02c4..c750f95b 100644 --- a/tests/unit/select/select_core.js +++ b/tests/unit/select/select_core.js @@ -95,4 +95,33 @@ $.testHelper.sequence(sequence, 1000); }); + module("Non native menus", { + setup: function() { + $.mobile.selectmenu.prototype.options.nativeMenu = false; + }, + teardown: function() { + $.mobile.selectmenu.prototype.options.nativeMenu = true; + } + }); + + asyncTest( "a large select option should not overflow", function(){ + // https://github.com/jquery/jquery-mobile/issues/1338 + var menu, select = $("#select-long-option-label"); + + $.testHelper.sequence([ + function(){ + // bring up the dialog + select.trigger("click"); + }, + + function() { + menu = $(".ui-selectmenu-list"); + + equal(menu.width(), menu.find("li:nth-child(2) .ui-btn-text").width(), "ui-btn-text element should not overflow") + start(); + } + ], 500); + + }); + })(jQuery);