You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/04/22 14:35:00 UTC

[GitHub] [airflow] ryanahamilton commented on a change in pull request #8269: [AIRFLOW-4357] Fix SVG tooltip positioning with custom scripting

ryanahamilton commented on a change in pull request #8269:
URL: https://github.com/apache/airflow/pull/8269#discussion_r413037526



##########
File path: airflow/www/templates/airflow/dags.html
##########
@@ -554,5 +552,33 @@ <h2>DAGs</h2>
       $(".loading-task-stats").remove();
       $(".loading-dag-stats").remove();
     }
+
+    function showSvgTooltip(text, offsetTop, offsetLeft) {
+      var tip = $('#svg-tooltip');
+      tip.children('.tooltip-inner').text(text);
+      var centeringOffset = tip.width() / 2;
+      tip.css({
+        "display": "block",
+        "left": offsetLeft + 12.5 - centeringOffset + 'px',// 12.5 == half of circle width
+        "top": offsetTop - 25 + 'px'// 25 == position above circle
+      });
+    }
+
+    function hideSvgTooltip() {
+      $('#svg-tooltip').css('display', 'none');
+    }
+
+    $(window).on('load', function() {
+      $('body').on('mouseover', '.has-svg-tooltip', function(e) {
+        var elem = e.target;
+        var text = elem.getAttribute('title');
+        var circ = document.getElementById(elem.id).getBoundingClientRect();

Review comment:
       Updated.




----------------------------------------------------------------
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:
users@infra.apache.org