← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4276: added ajaxComplete handler to call responseReceived when getOrganisationUnitTree is loaded

 

------------------------------------------------------------
revno: 4276
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-08-11 09:20:39 +0200
message:
  added ajaxComplete handler to call responseReceived when getOrganisationUnitTree is loaded
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/menu.vm


--
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/ouwt/ouwt.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js	2011-08-10 13:44:25 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js	2011-08-11 07:20:39 +0000
@@ -22,6 +22,15 @@
 $( document ).ready( function()
 {
     selection.load();
+
+    jQuery( "body" ).bind( "ajaxComplete", function( e, xhr, settings )
+    {
+        if ( settings.url.indexOf( "getOrganisationUnitTree" ) )
+        {
+            selection.responseReceived();
+            jQuery( "body" ).unbind( "ajaxSuccess" );
+        }
+    } );
 } );
 
 // -----------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/menu.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/menu.vm	2011-08-08 15:09:46 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/menu.vm	2011-08-11 07:20:39 +0000
@@ -1,13 +1,6 @@
 <script type="text/javascript">
 	jQuery(document).ready(function() {
 		selection.setListenerFunction( organisationUnitSelected );
-
-		jQuery("body").bind("ajaxSuccess", function(e, xhr, settings) {
-			if(settings.url.indexOf("getOrganisationUnitTree")) {
-				selection.responseReceived();
-				jQuery("body").unbind("ajaxSuccess");
-			}
-		});
 	});
 </script>