auto save map positions

This commit is contained in:
Oliver Gorwits
2018-03-19 19:01:11 +00:00
parent 938b375df6
commit 6b3e4ceba7
3 changed files with 15 additions and 39 deletions

View File

@@ -23,13 +23,6 @@
$('.nd_modal').modal({show: false});
$("[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 {
$('#nd_netmap-save').prop('disabled', false).addClass('btn-info');
}
}
// on load, establish global delegations for now and future
@@ -147,15 +140,6 @@
.filter(function(n) { return n.selected })
.each(function(n) { n.fixed = true });
});
$('#nd_netmap-save').on('click', function(event) {
event.preventDefault();
// if user enters vlan but does not submit this will save wrong data
$.post(
'[% uri_for('/ajax/data/device/netmappositions') %]'
,$("#nd_vlan-entry, #nd_hgroup-select, input[name='mapshow']").serialize()
+ '&positions=' + JSON.stringify(graph.positions())
);
});
$('#nd_netmap-zoomtodevice').on('click', function(event) {
event.preventDefault();
var node = graph.nodeDataById( graph['nd2']['centernode'] );