Skip to content

Commit b12726b

Browse files
author
Mark Robinson
committed
Add new icons to select parents and children, with tooltips
1 parent ebb578e commit b12726b

File tree

5 files changed

+62
-15
lines changed

5 files changed

+62
-15
lines changed

src/main/resources/static/css/main.css

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,37 @@ body {
5656
margin-left: 10px;
5757
}
5858

59-
#fullscreen-open, #fullscreen-close {
60-
cursor: pointer;
61-
font-size: 25px;
59+
.graphControl {
6260
position: absolute;
6361
top: 10px;
6462
right: 25px;
63+
cursor: pointer;
64+
font-size: 25px;
6565
opacity: 0.333;
6666
}
6767

68+
.graphControl:hover {
69+
opacity: 1;
70+
}
71+
6872
#fullscreen-close {
6973
top: 25px;
7074
}
7175

72-
#fullscreen-open:hover, #fullscreen-close:hover {
73-
opacity: 1;
76+
#selectChildren, #selectParents {
77+
top: 8px;
78+
width: 30px;
79+
height: 35px;
80+
}
81+
82+
#selectChildren {
83+
left: 25px;
84+
}
85+
86+
#selectParents {
87+
left: 62px;
88+
height: 32px;
89+
width: 50px;
7490
}
7591

7692
#fullScreenGraphModal .modal-dialog {
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 14 additions & 0 deletions
Loading

src/main/resources/static/js/workflow.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ requirejs.config({
2727
'jquery.svg': 'jquery-svg/jquery.svg.min',
2828
'jquery.svgdom': 'jquery-svg/jquery.svgdom.min',
2929
'bootstrap.modal': 'bootstrap/js/modal',
30+
'bootstrap.tooltip': 'bootstrap/js/tooltip',
3031
'svg-pan-zoom': 'svg-pan-zoom/dist/svg-pan-zoom.min',
3132
'hammerjs': 'hammerjs/hammer.min'
3233
},
3334
shim: {
3435
'jquery.svg': ['jquery'],
3536
'jquery.svgdom': ['jquery'],
36-
'bootstrap.modal': ['jquery']
37+
'bootstrap.modal': ['jquery'],
38+
'bootstrap.tooltip': ['jquery']
3739
}
3840
});
3941

@@ -104,6 +106,10 @@ require(['jquery', 'bootstrap.modal', 'svg-pan-zoom', 'hammerjs', 'jquery.svg'],
104106
loadURL: $("#graph").attr("data-svgurl"),
105107
onLoad: enablePanZoom
106108
});
109+
$("#graphFullscreen").svg({
110+
loadURL: $("#graph").attr("data-svgurl"),
111+
onLoad: enablePanZoom
112+
});
107113

108114
/**
109115
* Enable svg-pan-zoom on the graph
@@ -127,7 +133,7 @@ require(['jquery', 'bootstrap.modal', 'svg-pan-zoom', 'hammerjs', 'jquery.svg'],
127133
$('#fullScreenGraphModal').on('shown.bs.modal', function (e) {
128134
// Timeout allows for modal to show
129135
setTimeout(function() {
130-
var fullGraph = svgPanZoom('#graphFullscreen', {
136+
var fullGraph = svgPanZoom('#graphFullscreen svg', {
131137
zoomEnabled: true,
132138
controlIconsEnabled: true,
133139
customEventsHandler: eventHandler
@@ -306,4 +312,10 @@ require(['jquery', 'jquery.svg', 'jquery.svgdom'],
306312
$(this).find("polygon").removeClass("hover");
307313
}
308314
}, ".node");
315+
});
316+
317+
require(['jquery', 'bootstrap.tooltip'],
318+
function ($) {
319+
// Alterative notation as only a single data-toggle attribute is allowed
320+
$('[data-tooltip="true"]').tooltip();
309321
});

src/main/resources/templates/workflow.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,8 @@ <h4 class="modal-title" id="dotGraphLabel">Workflow DOT Graph</h4>
110110
<h4 class="modal-title" id="fullScreenGraphLabel">Workflow Graph</h4>
111111
</div>
112112
<div class="modal-body">
113-
<span id="fullscreen-close" data-dismiss="modal" class="close glyphicon glyphicon-resize-full"></span>
114-
<object id="graphFullscreen" th:data="@{'/workflows/' + ${workflow.id} + '/graph/svg'}" type="image/svg+xml">
115-
<img th:src="@{'/workflows/' + ${workflow.id} + '/graph/png'}" alt="workflow graph" />
116-
</object>
113+
<span id="fullscreen-close" data-dismiss="modal" class="close glyphicon glyphicon-resize-small graphControl" data-tooltip="true" title="Close"></span>
114+
<div id="graphFullscreen"></div>
117115
</div>
118116
</div>
119117
</div>
@@ -129,7 +127,7 @@ <h2>Workflow: <span th:text="${workflow.label}">Workflow Name</span></h2>
129127
</a>
130128
<i>Fetched <span th:text="${{workflow.retrievedOn}}">01/12/16 at 21:00</span></i>
131129
<span th:if="${workflow.roBundle == null}" id="ajaxRequired"></span>
132-
<span th:class="${workflow.roBundle != null} ? hide : ''" id="generating"> - Generating download link <img alt="loading" src="/img/loading.svg" width="20" height="20" /></span>
130+
<span th:class="${workflow.roBundle != null} ? hide : ''" id="generating"> - Generating download link <img alt="loading" src="../static/img/loading.svg" th:src="@{/img/loading.svg}" width="20" height="20" /></span>
133131
<span th:class="${workflow.roBundle == null} ? hide : ''" id="generated">
134132
- <a th:href="@{'/workflows/' + ${workflow.id} + '/download'}" id="download" href="#" download="bundle.zip">Download as Research Object Bundle</a>
135133
<a href="http://www.researchobject.org/" rel="noopener" target="_blank">[?]</a>
@@ -151,15 +149,17 @@ <h2>Workflow: <span th:text="${workflow.label}">Workflow Name</span></h2>
151149
<div class="row">
152150
<div class="col-md-12">
153151
<div id="visualisation" class="jumbotron">
154-
<span id="fullscreen-open" data-toggle="modal" data-target="#fullScreenGraphModal" class="glyphicon glyphicon-resize-full"></span>
152+
<span id="fullscreen-open" data-toggle="modal" data-target="#fullScreenGraphModal" data-tooltip="true" class="glyphicon glyphicon-resize-full graphControl" title="Expand"></span>
153+
<img id="selectChildren" class="graphControl" th:src="@{/img/children-logo.svg}" src="../static/img/children-logo.svg" alt="children" data-tooltip="true" title="Select All Children" />
154+
<img id="selectParents" class="graphControl" th:src="@{/img/parents-logo.svg}" src="../static/img/parents-logo.svg" alt="parents" data-tooltip="true" title="Select All Parents" />
155155
<div id="graph" data-th-attr="data-svgurl=@{'/workflows/' + ${workflow.id} + '/graph/svg'}"></div>
156156
</div>
157157
<div th:if="${workflow.dockerLink != null}">
158158
<h2 style="float:left;">Requires: </h2>
159159
<a th:unless="${workflow.dockerLink == 'true'}" th:href="${workflow.dockerLink}" rel="noopener" target="_blank">
160-
<img id="dockerLogo" src="/img/Docker-logo.png" alt="docker logo" />
160+
<img id="dockerLogo" th:src="@{/img/Docker-logo.png}" src="../static/img/Docker-logo.png" alt="docker logo" />
161161
</a>
162-
<img th:if="${workflow.dockerLink == 'true'}" id="dockerLogo" src="/img/Docker-logo.png" alt="docker logo" />
162+
<img th:if="${workflow.dockerLink == 'true'}" id="dockerLogo" th:src="@{/img/Docker-logo.png}" src="../static/img/Docker-logo.png" alt="docker logo" />
163163
</div>
164164
<h2>Inputs</h2>
165165
<div th:if="${workflow.inputs.isEmpty()}" class="alert alert-info">

0 commit comments

Comments
 (0)