You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by as...@apache.org on 2021/06/22 13:46:01 UTC

[airflow] 11/38: set max tree width to 1200px (#16067)

This is an automated email from the ASF dual-hosted git repository.

ash pushed a commit to branch v2-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit eefa56313a795e2c56b249d97178bc15406cf1c3
Author: Brent Bovenzi <br...@gmail.com>
AuthorDate: Tue May 25 16:20:31 2021 -0400

    set max tree width to 1200px (#16067)
    
    the totalwidth of the tree view will depend on the window size like before, but max out at 1200px
    
    (cherry picked from commit f2aa9b58cb012a3bc347f43baeaa41ecdece4cbf)
---
 airflow/www/static/js/tree.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/airflow/www/static/js/tree.js b/airflow/www/static/js/tree.js
index 04702a7..cc8276d 100644
--- a/airflow/www/static/js/tree.js
+++ b/airflow/www/static/js/tree.js
@@ -70,7 +70,9 @@ document.addEventListener('DOMContentLoaded', () => {
     if (node.depth > treeDepth) treeDepth = node.depth;
   });
   treeDepth += 1;
-  const squareX = window.innerWidth - (data.instances.length * squareSize) - (treeDepth * 50);
+
+  const innerWidth = window.innerWidth > 1200 ? 1200 : window.innerWidth;
+  const squareX = innerWidth - (data.instances.length * squareSize) - (treeDepth * 50);
 
   const squareSpacing = 2;
   const margin = {