Jelajahi Sumber

AMBARI-1225. Add Hosts wizard popup is too small. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1435450 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 tahun lalu
induk
melakukan
a49331e19a

+ 2 - 0
CHANGES.txt

@@ -17,6 +17,8 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-1225. Add Hosts wizard popup is too small. (yusaku)
+
  AMBARI-1224. Drop the "all" option from Hosts > Component Filter and
  Jobs > Users Filter. (yusaku)
 

+ 3 - 0
ambari-web/app/routes/add_host_routes.js

@@ -44,6 +44,9 @@ module.exports = Em.Route.extend({
           this.hide();
           App.router.get('updateController').set('isWorking', true);
           router.transitionTo('hosts.index');
+        },
+        didInsertElement: function(){
+          this.fitHeight();
         }
       });
 

+ 3 - 0
ambari-web/app/routes/add_service_routes.js

@@ -44,6 +44,9 @@ module.exports = Em.Route.extend({
             this.hide();
             App.router.get('updateController').set('isWorking', true);
             App.router.transitionTo('main.services')
+          },
+          didInsertElement: function(){
+            this.fitHeight();
           }
         });
         router.transitionTo('step' + addServiceController.get('currentStep'));

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

@@ -73,6 +73,20 @@ App.ModalPopup = Ember.View.extend({
       var block = this.$().find('#modal > .modal-body').first();
       block.css('max-height', $(window).height()- block.offset().top - 300); // fix popup height
     }
+  },
+
+  fitHeight: function(){
+    var popup = this.$().find('#modal');
+    var block = this.$().find('#modal > .modal-body');
+    var wh = $(window).height();
+
+    var top = wh * .05;
+    popup.css({
+      'top' : top + 'px',
+      'marginTop' : 0
+    });
+
+    block.css('max-height', $(window).height()- top * 2 - 100);
   }
 });