Ver Fonte

AMBARI-13374. Issue with overlay for config groups popup on the ASW (onechiporenko)

Oleg Nechiporenko há 9 anos atrás
pai
commit
1fcc5ab1e0

+ 3 - 1
ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js

@@ -176,7 +176,9 @@ App.MainAlertDefinitionActionsController = Em.ArrayController.extend({
         this.set('disablePrimary', !modified);
         this.set('disablePrimary', !modified);
       }.observes('subViewController.isDefsModified'),
       }.observes('subViewController.isDefsModified'),
 
 
-      didInsertElement: Em.K
+      didInsertElement: function () {
+        this.fitZIndex();
+      }
 
 
     });
     });
   },
   },

+ 3 - 1
ambari-web/app/controllers/main/service/manage_config_groups_controller.js

@@ -931,7 +931,9 @@ App.ManageConfigGroupsController = Em.Controller.extend(App.ConfigOverridable, {
         this.set('disablePrimary', !modified);
         this.set('disablePrimary', !modified);
       }.observes('subViewController.isHostsModified'),
       }.observes('subViewController.isHostsModified'),
 
 
-      didInsertElement: Em.K
+      didInsertElement: function () {
+        this.fitZIndex();
+      }
     });
     });
   }
   }
 
 

+ 11 - 5
ambari-web/app/views/common/modal_popup.js

@@ -70,21 +70,27 @@ App.ModalPopup = Ember.View.extend({
         block.css('max-height', $(window).height() - block.offset().top  - this.marginBottom + $(window).scrollTop()); // fix popup height
         block.css('max-height', $(window).height() - block.offset().top  - this.marginBottom + $(window).scrollTop()); // fix popup height
       }
       }
     }
     }
-    // If popup is opened from another popup it should be displayed above
+    this.fitZIndex();
+    var firstInputElement = this.$('#modal').find(':input').not(':disabled').first();
+    this.focusElement(firstInputElement);
+  },
+
+  /**
+   * If popup is opened from another popup it should be displayed above
+   * @method fitZIndex
+   */
+  fitZIndex: function () {
     var existedPopups = $('.modal-backdrop');
     var existedPopups = $('.modal-backdrop');
     if (existedPopups) {
     if (existedPopups) {
       var maxZindex = 1;
       var maxZindex = 1;
       existedPopups.each(function(index, popup) {
       existedPopups.each(function(index, popup) {
         if ($(popup).css('z-index') > maxZindex) {
         if ($(popup).css('z-index') > maxZindex) {
           maxZindex = $(popup).css('z-index');
           maxZindex = $(popup).css('z-index');
-      }
+        }
       });
       });
       this.$().find('.modal-backdrop').css('z-index', maxZindex * 2);
       this.$().find('.modal-backdrop').css('z-index', maxZindex * 2);
       this.$().find('.modal').css('z-index', maxZindex * 2 + 1);
       this.$().find('.modal').css('z-index', maxZindex * 2 + 1);
     }
     }
-
-    var firstInputElement = this.$('#modal').find(':input').not(':disabled').first();
-    this.focusElement(firstInputElement);
   },
   },
 
 
   focusElement: function(elem) {
   focusElement: function(elem) {