← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10888: minor change to the way coordinates are uploaded

 

------------------------------------------------------------
revno: 10888
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2013-05-19 13:23:02 +0700
message:
  minor change to the way coordinates are uploaded
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-05-19 06:11:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-05-19 06:23:02 +0000
@@ -2019,20 +2019,21 @@
 		alert(i18n_enter_a_value_greater_than_or_equal_to_nagetive_90);
 		isValid = false;
 	}
-	
-	if( isValid ){
-		jQuery.postJSON( "saveCoordinatesEvent.action",
-			{ 
-				programStageInstanceId: programStageInstanceId,
-				longitude: longitude,
-				latitude: latitude
-			}, 
-			function( json ) 
-			{   
-				 byId('longitude').style.backgroundColor = SUCCESS_COLOR;
-				 byId('latitude').style.backgroundColor = SUCCESS_COLOR;
-			});
-	}
+
+    if ( isValid ) {
+        $.ajax( {
+            url: 'saveCoordinatesEvent.action',
+            data: {
+                programStageInstanceId: programStageInstanceId,
+                longitude: longitude,
+                latitude: latitude
+            },
+            dataType: 'json'
+        } ).done(function() {
+            byId( 'longitude' ).style.backgroundColor = SUCCESS_COLOR;
+            byId( 'latitude' ).style.backgroundColor = SUCCESS_COLOR;
+        });
+    }
 }
 
 // ---------------------------------------------------------------------------------