aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/dialog/dialog_methods.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2013-01-31 17:20:19 -0500
committerScott González <scott.gonzalez@gmail.com>2013-01-31 17:20:19 -0500
commit62cda1f95d0e7040153f0b5fe5745d199a0a094e (patch)
tree5f0d3e32e5298fb76de50efe6b96b07c6e7c2116 /tests/unit/dialog/dialog_methods.js
parent85dfcdf766cba709213c81ca2b8432b797aa45c1 (diff)
downloadjquery-ui-62cda1f95d0e7040153f0b5fe5745d199a0a094e.tar.gz
jquery-ui-62cda1f95d0e7040153f0b5fe5745d199a0a094e.zip
Dialog: Set the _isOpen flag immediately in open(). Fixes #8958 - Dialog: Double ui-widget-overlay when opening modal dialog triggers an event opening same dialog.
Diffstat (limited to 'tests/unit/dialog/dialog_methods.js')
-rw-r--r--tests/unit/dialog/dialog_methods.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/unit/dialog/dialog_methods.js b/tests/unit/dialog/dialog_methods.js
index 2c3495ca2..6de185513 100644
--- a/tests/unit/dialog/dialog_methods.js
+++ b/tests/unit/dialog/dialog_methods.js
@@ -193,6 +193,35 @@ test("#6137: dialog('open') causes form elements to reset on IE7", function() {
d1.remove();
});
+asyncTest( "#8958: dialog can be opened while opening", function() {
+ expect( 1 );
+
+ var element = $( "<div>" ).dialog({
+ autoOpen: false,
+ modal: true,
+ open: function() {
+ equal( $( ".ui-widget-overlay" ).length, 1 );
+ start();
+ }
+ });
+
+ $( "#favorite-animal" )
+ // We focus the input to start the test. Once it receives focus, the
+ // dialog will open. Opening the dialog, will cause an element inside
+ // the dialog to gain focus, thus blurring the input.
+ .bind( "focus", function() {
+ element.dialog( "open" );
+ })
+ // When the input blurs, the dialog is in the process of opening. We
+ // try to open the dialog again, to make sure that dialogs properly
+ // handle a call to the open() method during the process of the dialog
+ // being opened.
+ .bind( "blur", function() {
+ element.dialog( "open" );
+ })
+ .focus();
+});
+
test("#5531: dialog width should be at least minWidth on creation", function () {
expect( 4 );
var element = $("<div></div>").dialog({