浏览代码

HUE-934 [oozie] Edit action in bigger popup or within the page

Maximized Bootstrap modal
Enrico Berti 13 年之前
父节点
当前提交
609be3d
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      apps/oozie/static/js/workflow.js

+ 9 - 0
apps/oozie/static/js/workflow.js

@@ -156,6 +156,15 @@ var ModalModule = function($, ko) {
 
   module.prototype.recenter = function(offset_x, offset_y) {
     var self = this;
+
+    var MARGIN = 10; // pixels around the modal
+
+    var modalContentHeight = (($(window).height() - MARGIN*2) -
+        (self.modal.find(".modal-header").outerHeight() + self.modal.find(".modal-header").outerHeight())) - 20;
+
+    self.modal.css("width", ($(window).width() - MARGIN*2)+"px");
+    self.modal.find(".modal-content").css("max-height", modalContentHeight+"px").css("height", modalContentHeight+"px");
+
     var top = ( ($(window).height() - self.modal.outerHeight(false)) / 2 );
     var left = ( ($(window).width() - self.modal.outerWidth(false)) / 2 );
     if (top < 0) {