eeshugerman commented on a change in pull request #5641: 
[AIRFLOW-4929][Revision] Improve display of JSON Variables in UI
URL: https://github.com/apache/airflow/pull/5641#discussion_r306074223
 
 

 ##########
 File path: airflow/www/templates/airflow/variable_edit.html
 ##########
 @@ -23,7 +23,8 @@
     #val { font-family: monospace; }
   </style>
   <script>
+    const val = document.getElementById('val');
     const height = Math.min(window.innerHeight * 0.5, val.scrollHeight);
-    document.getElementById('val').style.height = `${height}px`;
+    val.style.height = `${height}px`;
 
 Review comment:
   When making a change requested in code review, I momentarily forgot that 
`height` depends on `val`, so I removed the line where `val` is defined. It 
turns out that it still works this way -- apparently `val` is already defined 
in the global scope by the inherited template -- but it is confusing and 
brittle, so I felt compelled to make this correction.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to