Dante 11 years ago
parent
commit
21a8a5e351

+ 16 - 0
assets/bootstrap-dialog/js/bootstrap-dialog.js

@@ -128,6 +128,19 @@
         });
         });
     };
     };
 
 
+    /**
+     * Move focus to next visible dialog.
+     */
+    BootstrapDialog.moveFocus = function() {
+        var lastDialogInstance = null;
+        $.each(BootstrapDialog.dialogs, function(id, dialogInstance) {
+            lastDialogInstance = dialogInstance;
+        });
+        if (lastDialogInstance !== null && lastDialogInstance.isRealized()) {
+            lastDialogInstance.getModal().focus();
+        }
+    };
+
     BootstrapDialog.prototype = {
     BootstrapDialog.prototype = {
         constructor: BootstrapDialog,
         constructor: BootstrapDialog,
         initOptions: function(options) {
         initOptions: function(options) {
@@ -834,6 +847,9 @@
             }
             }
             this.setOpened(false);
             this.setOpened(false);
 
 
+            // Move focus to the last visible dialog.
+            BootstrapDialog.moveFocus();
+
             return this;
             return this;
         }
         }
     };
     };

File diff suppressed because it is too large
+ 1 - 1
assets/bootstrap-dialog/js/bootstrap-dialog.min.js