fix netmap position saving
This commit is contained in:
@@ -216,7 +216,7 @@ function saveMapPositions() {
|
||||
graph.inspect().main.nodes.each(function(n) { n.fixed = true });
|
||||
$.post(
|
||||
'[% uri_for('/ajax/data/device/netmappositions') %]'
|
||||
,$("#nd_vlan-entry, #nd_hgroup-select, #nd_lgroup-select, input[name='mapshow']").serialize()
|
||||
,$("#nd_vlan-entry, #nd_hgroup-select, #nd_lgroup-select, input[name='q'], input[name='mapshow']").serialize()
|
||||
+ '&positions=' + JSON.stringify(graph.positions())
|
||||
);
|
||||
toastr.success('Saved map positions.');
|
||||
|
||||
@@ -145,6 +145,10 @@
|
||||
var node = graph.nodeDataById( graph['nd2']['centernode'] );
|
||||
graph.zoomSmooth(node.x, node.y, node.radius * 125);
|
||||
});
|
||||
$('#nd_netmap-save').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
saveMapPositions();
|
||||
});
|
||||
|
||||
// activity for admin tasks in device details
|
||||
$('#details_pane').on('click', '.nd_adminbutton', function(event) {
|
||||
|
||||
@@ -30,6 +30,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label><span id="">Positions: </span>
|
||||
<button id="nd_netmap-save" class="nd_sidebar-btn-netmap btn btn-small btn-info">
|
||||
<i class="icon-save icon-large pull-left nd_navbar-icon"></i> Save</button>
|
||||
</label>
|
||||
|
||||
<table margin="0" border="0" class="nd_netmap-pin-controls">
|
||||
<tr>
|
||||
<td class="nd_netmap-pin-controls-top-row">
|
||||
|
||||
Reference in New Issue
Block a user