Added check to save positions so no POST action is made if there is nothing to save

This commit is contained in:
xevidos 2019-07-01 09:23:51 -04:00
parent 819602a87e
commit 647509e201

View File

@ -1013,14 +1013,17 @@
uploadPositions: function() {
$.ajax( {
type: 'POST',
url: codiad.active.controller + '?action=save_positions',
data: {
positions: ( JSON.stringify( codiad.active.positions ) )
},
success: function( data ) {},
});
if( Object.keys( codiad.active.positions ).length > 0 ) {
$.ajax( {
type: 'POST',
url: codiad.active.controller + '?action=save_positions',
data: {
positions: ( JSON.stringify( codiad.active.positions ) )
},
success: function( data ) {},
});
}
},
savePosition: function() {