Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / apps / workbench / app / views / application / _svg_div.html.erb
index f3f6a71c12787061bf7d8fb57f85dc35990f992b..8a417d9e0ea3ad7e6af3df3cd74e81daa9c034ea 100644 (file)
@@ -1,4 +1,9 @@
+<%# Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: AGPL-3.0 %>
+
 <%= content_for :css do %>
+/* Need separate style for each instance of svg div because javascript will manipulate the properties. */
 #<%= divId %> {
  padding-left: 3px;
  overflow: auto;
  border-width: 1px;
  border-color: gray;
  position: absolute;
- left: 1px;
-
+ left: 25px;
+ right: 25px;
+}
+path:hover {
+stroke-width: 5;
 }
+path {
+stroke-linecap: round;
+}
+<% end %>
+
+<%= content_for :js do %>
+    $(window).on('load', function() {
+      $(window).on('load resize scroll', function () { graph_zoom("<%= divId %>","<%=svgId %>", 1) } );
+    });
 <% end %>
 
-<div id="_<%= divId %>_container" style="padding-top: 41px; margin-top: -41px">
-  <script>
-    (function() {
-      var fn = function () { graph_zoom("<%= divId %>", "<%=svgId %>", 1) };
-      $(window).resize(fn);
-      $(window).load(fn);
-      $(window).scroll(fn);
-    })();
-  </script>
+<div id="_<%= divId %>_container">
   <div style="text-align: right">
-    <a style="cursor: pointer"><span class="icon-zoom-out" onclick="graph_zoom('<%= divId %>', '<%= svgId %>', .9)"></span></a>
-    <a style="cursor: pointer"><span class="icon-zoom-in" onclick="graph_zoom('<%= divId %>', '<%= svgId %>', 1./.9)"></span></a>
+    <a style="cursor: pointer"><span class="glyphicon glyphicon-zoom-out" onclick="graph_zoom('<%= divId %>', '<%= svgId %>', .9)"></span></a>
+    <a style="cursor: pointer"><span class="glyphicon glyphicon-zoom-in" onclick="graph_zoom('<%= divId %>', '<%= svgId %>', 1./.9)"></span></a>
   </div>
 
-  <div id="<%= divId %>">
-    <span id="_<%= divId %>_center" style="padding-left: 300px"/>
+  <div id="<%= divId %>" class="smart-scroll">
+    <span id="_<%= divId %>_center" style="padding-left: 0px"></span>
     <%= raw(svg) %>
   </div>
-  <div id="_<%= divId %>_padding" style="padding-bottom: 1em" />
 </div>