Browse Source

AMBARI-8439. Add Host Wizard: Host Checks popup is displayed behind the wizard (onechiporenko)

Oleg Nechiporenko 10 năm trước cách đây
mục cha
commit
81d5c7bdf4

+ 4 - 4
ambari-web/app/views/common/modal_popup.js

@@ -63,7 +63,7 @@ App.ModalPopup = Ember.View.extend({
 
   didInsertElement: function () {
     if (this.autoHeight) {
-      var block = $('#modal > .modal-body').first();
+      var block = this.$().find('#modal > .modal-body').first();
       if(block.offset()) {
         block.css('max-height', $(window).height() - block.offset().top  - 300 + $(window).scrollTop()); // fix popup height
       }
@@ -77,11 +77,11 @@ App.ModalPopup = Ember.View.extend({
           maxZindex = $(popup).css('z-index');
       }
       });
-      $('.modal-backdrop').css('z-index', maxZindex * 2);
-      $('.modal').css('z-index', maxZindex * 2 + 1);
+      this.$().find('.modal-backdrop').css('z-index', maxZindex * 2);
+      this.$().find('.modal').css('z-index', maxZindex * 2 + 1);
     }
 
-    var firstInputElement = $('#modal').find(':input').not(':disabled').first();
+    var firstInputElement = this.$('#modal').find(':input').not(':disabled').first();
     this.focusElement(firstInputElement);
   },
 

+ 8 - 5
ambari-web/test/views/common/modal_popup_test.js

@@ -25,12 +25,15 @@ describe('App.ModalPopup', function() {
 
   beforeEach(function () {
     popup = App.ModalPopup.create(
-        {
-          primary: 'test',
-          secondary: 'test',
-          header: 'test',
-          body: '<p>text</p><input type="text"><input type="checkbox"><input type="button">'
+      {
+        primary: 'test',
+        secondary: 'test',
+        header: 'test',
+        body: '<p>text</p><input type="text"><input type="checkbox"><input type="button">',
+        $: function () {
+          return $(this);
         }
+      }
     );
   });