← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12481: minor fix in jquery.utils.js, return promise object from ajax calls, makes it possible to add add...

 

------------------------------------------------------------
revno: 12481
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-10-07 17:30:32 +0200
message:
  minor fix in jquery.utils.js, return promise object from ajax calls, makes it possible to add additional callback handlers
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.utils.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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.utils.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.utils.js	2013-10-07 15:11:57 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.utils.js	2013-10-07 15:30:32 +0000
@@ -17,15 +17,15 @@
 jQuery.extend( {
 	
 	postJSON: function( url, data, success ) {
-		$.ajax( { url:url, data:data, success:success, type:'post', dataType:'json', contentType:'application/x-www-form-urlencoded;charset=utf-8' } );
+		return $.ajax( { url:url, data:data, success:success, type:'post', dataType:'json', contentType:'application/x-www-form-urlencoded;charset=utf-8' } );
 	},
 
 	postUTF8: function( url, data, success ) {
-		$.ajax( { url:url, data:data, success:success, type:'post', contentType:'application/x-www-form-urlencoded;charset=utf-8' } );
+		return $.ajax( { url:url, data:data, success:success, type:'post', contentType:'application/x-www-form-urlencoded;charset=utf-8' } );
 	},
 	
 	loadNoCache: function( elementId, url, data ) {
-		$.ajax( { url:url, data:data, type:'get', dataType:'html', success:function( data ) {
+		return $.ajax( { url:url, data:data, type:'get', dataType:'html', success:function( data ) {
 			$( '#' + elementId ).html( data );
 		} } );
 	},