From 5f966c90f0fc516c48d1574c67b85ca452f3516c Mon Sep 17 00:00:00 2001 From: stefangabos Date: Tue, 3 Sep 2019 22:20:49 +0300 Subject: [PATCH] Added example about overlapping dialogs --- examples/examples.js | 53 +++++++++++++++++++++++++++++++++++++-- examples/flat.html | 36 ++++++++++++++++++++++---- examples/index.html | 36 ++++++++++++++++++++++---- examples/materialize.html | 36 ++++++++++++++++++++++---- 4 files changed, 144 insertions(+), 17 deletions(-) diff --git a/examples/examples.js b/examples/examples.js index d0e08c2..c50f12d 100644 --- a/examples/examples.js +++ b/examples/examples.js @@ -283,11 +283,60 @@ $(document).ready(function() { }); $('#example11').on('click', function() { + new $.Zebra_Dialog('This is the first dialog box. Try opening another one.', { + auto_focus_button: $('body.materialize').length ? false : true, + buttons: [ + 'Close', + { + caption: 'Open another dialog box', + callback: function() { + new $.Zebra_Dialog('This is the second dialog box. Notice that the backdrops are not overlapping. Pressing ESC or clicking on the backdrop will close this dialog box but not the first one.', { + auto_focus_button: $('body.materialize').length ? false : true, + buttons: [ + 'Close', + { + caption: 'Open yet another dialog box', + callback: function() { + new $.Zebra_Dialog('This is the third dialog box. Notice that the backdrops are not overlapping. Pressing ESC or clicking on the backdrop will close this dialog box but not the other ones.', { + auto_focus_button: $('body.materialize').length ? false : true, + buttons: [ + 'Close', + { + caption: 'Open the last dialog box', + callback: function() { + new $.Zebra_Dialog('This is the fourth dialog box. Notice that the backdrops are not overlapping. Pressing ESC or clicking on the backdrop will close this dialog box but not the other ones.', { + auto_focus_button: $('body.materialize').length ? false : true, + position: ['left + 20', 'top + 20'], + title: 'Fourth dialog box' + }); + return false; + + } + } + ], + position: ['left + 20', 'bottom - 20'], + title: 'Third dialog box' + }); + return false; + } + } + ], + position: ['right - 20', 'top + 20'], + title: 'Second dialog box' + }); + return false; + } + } + ], + title: 'First dialog box' + }); + }); + + $('#example12').on('click', function() { new $.Zebra_Dialog('I love coffee!', { auto_focus_button: $('body.materialize').length ? false : true, custom_class: 'myclass', - title: 'Customizing the appearance', - width: 600 + title: 'Customizing the appearance' }); }); diff --git a/examples/flat.html b/examples/flat.html index 92527d5..db6ec5f 100644 --- a/examples/flat.html +++ b/examples/flat.html @@ -84,8 +84,9 @@

Zebra Dialog

08. Content loaded from an element on the page
09. Content loaded via AJAX
10. Content loaded in an iFrame
+ 11. Overlapping dialogs
- 11. Customizing the appearance
+ 12. Customizing the appearance
@@ -488,6 +489,32 @@

10. Content loaded in an iFrame

Click here to open. + + +
+ ▲ To the top +
+ + + +

11. Overlapping dialogs

+ +
+                    // unless explicitly specified, the height of the dialog box will
+                    // be automatically computed to fit the loaded content's height
+
+                    new $.Zebra_Dialog({
+                        source: {
+                            ajax: "ajax.html"
+                        },
+                        title: "Content loaded via AJAX",
+                        width: 600
+                    });
+ +
+ Click here to open. +
+
@@ -496,7 +523,7 @@

10. Content loaded in an iFrame

-

11. Customizing the appearance

+

12. Customizing the appearance

Let's make the title bar have a dark-blue background and show a custom icon

@@ -518,12 +545,11 @@

11. Customizing the appearance

                     new $.Zebra_Dialog("I love coffee!", {
                         custom_class: "myclass",
-                        title: "Customizing the appearance",
-                        width: 600
+                        title: "Customizing the appearance"
                     });
- Click here to open. + Click here to open.
diff --git a/examples/index.html b/examples/index.html index cb5717f..0dda64f 100644 --- a/examples/index.html +++ b/examples/index.html @@ -84,8 +84,9 @@

Zebra Dialog

08. Content loaded from an element on the page
09. Content loaded via AJAX
10. Content loaded in an iFrame
+ 11. Overlapping dialogs
- 11. Customizing the appearance
+ 12. Customizing the appearance
@@ -488,6 +489,32 @@

10. Content loaded in an iFrame

Click here to open. + + +
+ ▲ To the top +
+ + + +

11. Overlapping dialogs

+ +
+                    // unless explicitly specified, the height of the dialog box will
+                    // be automatically computed to fit the loaded content's height
+
+                    new $.Zebra_Dialog({
+                        source: {
+                            ajax: "ajax.html"
+                        },
+                        title: "Content loaded via AJAX",
+                        width: 600
+                    });
+ +
+ Click here to open. +
+
@@ -496,7 +523,7 @@

10. Content loaded in an iFrame

-

11. Customizing the appearance

+

12. Customizing the appearance

Let's make the title bar have a dark-blue background and show a custom icon

@@ -518,12 +545,11 @@

11. Customizing the appearance

                     new $.Zebra_Dialog("I love coffee!", {
                         custom_class: "myclass",
-                        title: "Customizing the appearance",
-                        width: 600
+                        title: "Customizing the appearance"
                     });
- Click here to open. + Click here to open.
diff --git a/examples/materialize.html b/examples/materialize.html index b53a543..a2e555d 100644 --- a/examples/materialize.html +++ b/examples/materialize.html @@ -84,8 +84,9 @@

Zebra Dialog

08. Content loaded from an element on the page
09. Content loaded via AJAX
10. Content loaded in an iFrame
+ 11. Overlapping dialogs
- 11. Customizing the appearance
+ 12. Customizing the appearance
@@ -488,6 +489,32 @@

10. Content loaded in an iFrame

Click here to open. + + +
+ ▲ To the top +
+ + + +

11. Overlapping dialogs

+ +
+                    // unless explicitly specified, the height of the dialog box will
+                    // be automatically computed to fit the loaded content's height
+
+                    new $.Zebra_Dialog({
+                        source: {
+                            ajax: "ajax.html"
+                        },
+                        title: "Content loaded via AJAX",
+                        width: 600
+                    });
+ +
+ Click here to open. +
+
@@ -496,7 +523,7 @@

10. Content loaded in an iFrame

-

11. Customizing the appearance

+

12. Customizing the appearance

Let's make the title bar have a dark-blue background and show a custom icon

@@ -518,12 +545,11 @@

11. Customizing the appearance

                     new $.Zebra_Dialog("I love coffee!", {
                         custom_class: "myclass",
-                        title: "Customizing the appearance",
-                        width: 600
+                        title: "Customizing the appearance"
                     });
- Click here to open. + Click here to open.