show ips functionality; improvement to maximise icon; bugfix d3-force label wrap

This commit is contained in:
Oliver Gorwits
2017-12-26 10:52:47 +00:00
parent 71a1a20909
commit 10ccaa78b1
5 changed files with 44 additions and 11 deletions

View File

@@ -24,6 +24,7 @@
$("[rel=tooltip]").tooltip({live: true});
$("[rel=popover]").popover({live: true});
// positions save not available in netmap neighbors view
if ($("input[name='mapshow']:checked").val() == 'neighbors') {
$('#nd_netmap-save').prop('disabled', true).removeClass('btn-info');
} else {
@@ -106,6 +107,27 @@
$("[rel=tooltip]").tooltip({live: true});
});
// netmap show controls
$('#nd_showips').change(function() {
if ($(this).prop('checked')) {
graph.inspect().main.nodes.each(function(n) {
if (n['ORIG_LABEL'] != n['ID']) {
n['LABEL'] = n['ORIG_LABEL'] + ' ' + n['ID'];
}
});
graph.wrapLabels(true).preventLabelOverlappingOnForceEnd(true).start();
} else {
graph.inspect().main.nodes.each(function(n) {
n['LABEL'] = n['ORIG_LABEL'];
});
graph.preventLabelOverlappingOnForceEnd(
($("input[name='mapshow']:checked").val() == 'neighbors')
? true : false
);
graph.wrapLabels(false).start();
}
});
// netmap pin/release controls
$('#nd_netmap-releaseall').on('click', function(event) {
event.preventDefault();