浏览代码

AMBARI-8491. Views in Ambari 'jump' upon screen refresh. (akovalenko)

Aleksandr Kovalenko 10 年之前
父节点
当前提交
fc2c0ba907
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      ambari-web/app/views/main/views/details.js

+ 2 - 0
ambari-web/app/views/main/views/details.js

@@ -68,6 +68,7 @@ App.MainViewsDetailsView = Em.View.extend({
     if (iframe != null && iframe.length > 0) {
       var childrenHeight = 0;
       var iframeElement = iframe[0];
+      var pageScrollTop = $(window).scrollTop();
       // set iframe height to 'auto' to get actual scrollHeight
       iframeElement.style.height = 'auto';
       if (iframeElement.contentWindow != null
@@ -80,6 +81,7 @@ App.MainViewsDetailsView = Em.View.extend({
       var iFrameHeight = Math.max(childrenHeight, defaultHeight);
       console.debug("IFrame final height = ", iFrameHeight);
       iframe.css('height', iFrameHeight);
+      $(window).scrollTop(pageScrollTop);
     }
   },