2012-10-15 20:12:21 +00:00
<!doctype html>
< html lang = "en" >
< head >
< meta charset = "utf-8" >
< title > Dialog Visual Test< / title >
2013-12-02 18:36:12 +00:00
< link rel = "stylesheet" href = "../../../themes/base/all.css" >
2015-09-30 07:49:13 +00:00
< script src = "../../../external/requirejs/require.js" > < / script >
< script src = "../../../demos/bootstrap.js" data-modules = "datepicker autocomplete tooltip" >
2012-10-23 14:31:10 +00:00
var dialog = $( "#dialog" ).dialog({
modal: true,
2012-11-15 22:23:25 +00:00
width: 500,
buttons: [
{
2012-11-16 18:26:22 +00:00
click: $.noop,
icons: {
primary: "ui-icon-check"
},
2012-11-15 22:23:25 +00:00
text: "Ok"
},
{
2012-11-16 18:26:22 +00:00
click: function() {
$( this ).dialog( "close" );
},
icons: {
primary: "ui-icon-cancel"
},
text: "Cancel",
showText: false
2012-11-15 22:23:25 +00:00
}
]
2012-11-25 05:18:51 +00:00
}).dialog("option", "height", 600),
2012-10-15 20:12:21 +00:00
2012-10-23 14:31:10 +00:00
datepickerDialog = $( "#dialog-datepicker" ).dialog({
2012-10-15 20:12:21 +00:00
autoOpen: false,
2012-10-23 00:33:15 +00:00
modal: true
2012-10-15 20:12:21 +00:00
}),
autocompleteDialog = $( "#dialog-autocomplete" ).dialog({
autoOpen: false,
modal: false,
width: 600
});
2015-05-14 01:57:04 +00:00
$( "#open-dialog" ).on( "click", function() {
2012-10-23 14:31:10 +00:00
dialog.dialog( "open" );
});
2015-05-14 01:57:04 +00:00
$( "#open-datepicker" ).on( "click", function() {
2012-10-15 20:12:21 +00:00
datepickerDialog.dialog( "open" );
});
2015-05-14 01:57:04 +00:00
$( "#open-autocomplete" ).on( "click", function() {
2012-10-15 20:12:21 +00:00
autocompleteDialog.dialog( "open" );
});
$( "#datepicker" ).datepicker();
$( "#autocomplete" ).autocomplete({
source: [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"Scheme"
]
});
2015-05-14 01:57:04 +00:00
$( "#destroy-dialog" ).on( "click", function() {
2012-11-16 18:33:55 +00:00
dialog.dialog( "destroy" ).show();
$( this ).remove();
});
2012-10-15 20:12:21 +00:00
$( document ).tooltip();
< / script >
< / head >
< body >
< p > WHAT: A modal dialog opening another modal dialog (including a datepicker), opening a non-modal dialog (including an autocomplete with tooltip applied). A regular link on the page, outside of the dialogs.< / p >
< p > EXPECTED: As long as a modal dialog is open, focus stays within the dialogs. Both mouse and keyboard interactions are captured and restricted to the dialog. When the nested modal dialog is open, the first modal dialog can't be interacted with, until the nested dialog is closed. When the third dialog is open (not modal), switching between the two dialogs is possible, both can be interacted with.< / p >
2012-10-23 14:31:10 +00:00
< button id = "open-dialog" > Reopen dialog< / button >
2012-12-02 11:50:17 +00:00
< div id = "dialog" title = "Basic dialog, but with a really long title that doesn't quite fit." >
2012-10-15 20:12:21 +00:00
< p > This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.< / p >
< p > < button id = "open-datepicker" > Open another window with a datepicker.< / button > < / p >
2012-11-16 18:33:55 +00:00
< p > < button id = "destroy-dialog" > Self destruct< / button > < / p >
2012-10-15 20:12:21 +00:00
< / div >
< div id = "dialog-datepicker" title = "A dialog with a datepicker" >
< p > Date: < input id = "datepicker" > < / p >
2012-11-16 19:24:57 +00:00
< p > < button id = "open-autocomplete" autofocus > Open another window with an autocomplete and a tooltip.< / button > < / p >
2012-10-15 20:12:21 +00:00
< / div >
< div id = "dialog-autocomplete" >
< label for = "autocomplete" > Tags: < / label >
< input id = "autocomplete" title = "Try typing something!" >
< / div >
2012-11-16 18:33:55 +00:00
< a href = "#" > Outside link< / a >
2012-10-15 20:12:21 +00:00
< / body >
< / html >