浏览代码

AMBARI-19196. BG operations modal windows are too small to show the content (in certain scenarios)[Chrome] (onechiporenko)

Oleg Nechiporenko 8 年之前
父节点
当前提交
22b027efb7
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      ambari-web/app/views/common/modal_popup.js

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

@@ -100,7 +100,7 @@ App.ModalPopup = Ember.View.extend({
 
   enterKeyPressed: function (event) {
     var primaryButton = this.$().find('.modal-footer > .btn-success').last();
-    if ((!$("*:focus").is("textarea")) && primaryButton.length > 0 && primaryButton.attr('disabled') !== 'disabled') {
+    if (!$("*:focus").is('textarea') && primaryButton.length > 0 && primaryButton.attr('disabled') !== 'disabled') {
       event.preventDefault();
       event.stopPropagation();
       primaryButton.click();
@@ -142,7 +142,9 @@ App.ModalPopup = Ember.View.extend({
       'marginTop': 0
     });
 
-    block.css('max-height', $(window).height() - top * 2 - (popup.height() - block.height()));
+    var newMaxHeight = $(window).height() - top * 2 - (popup.height() - block.height());
+    newMaxHeight = Math.max(newMaxHeight, 500);
+    block.css('max-height', newMaxHeight);
   }
 });