← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11964: Fixed - Return the Person management page when to click Back button of the browser.

 

------------------------------------------------------------
revno: 11964
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-09-07 21:38:55 +0700
message:
  Fixed - Return the Person management page when to click Back button of the browser.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.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-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm	2013-08-01 03:15:38 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm	2013-09-07 14:38:55 +0000
@@ -137,4 +137,35 @@
 	setFieldValue('startDueDate','');
 	setFieldValue('endDueDate','');
 	jQuery('#emptyProgramOption').text('[' + '$i18n.getString("view_all")' + ']');
+	
+	
+	jQuery(document).ready(function($) {
+		if (window.history && window.history.pushState) {
+			$(window).on('popstate', function() {
+			  var hashLocation = location.hash;
+			  var hashSplit = hashLocation.split("#!/");
+			  var hashName = hashSplit[1];
+
+			  if (hashName !== '') {
+				var hash = window.location.hash;
+				if (hash === '') {
+				  window.location.href="patient.action";
+				}
+			  }
+			});
+			window.history.pushState('patient', null, './#patient');
+	}
+	
+	$( "#orgUnitTree" ).one( "ouwtLoaded", function () {
+        var def = $.Deferred();
+        var promise = def.promise();
+        promise = promise.then( function () {
+            selection.setListenerFunction( organisationUnitSelected );
+        } );
+
+        def.resolve();
+    } );
+
+});
+	
 </script>
\ No newline at end of file