瀏覽代碼

AMBARI-3508. Multiple popups on the "Install, Start, Test" step. (onechiporenko)

Oleg Nechiporenko 11 年之前
父節點
當前提交
fc1ea2b60a
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      ambari-web/app/views/common/modal_popup.js

+ 12 - 0
ambari-web/app/views/common/modal_popup.js

@@ -84,6 +84,18 @@ App.ModalPopup = Ember.View.extend({
       var block = this.$().find('#modal > .modal-body').first();
       block.css('max-height', $(window).height() - block.offset().top - 300 + $(window).scrollTop()); // fix popup height
     }
+    // If popup is opened from another popup it should be displayed above
+    var existedPopups = $(document).find('.modal-backdrop');
+    if (existedPopups) {
+      var maxZindex = 1;
+      existedPopups.each(function(index, popup) {
+        if ($(popup).css('z-index') > maxZindex) {
+          maxZindex = $(popup).css('z-index');
+        }
+      });
+      this.$().find('.modal-backdrop').css('z-index', maxZindex * 2);
+      this.$().find('.modal').css('z-index', maxZindex * 2 + 1);
+    }
   },
 
   fitHeight: function () {