← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7714: disable buttons while waiting in org unit dist report

 

------------------------------------------------------------
revno: 7714
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-07-26 10:12:17 +0200
message:
  disable buttons while waiting in org unit dist report
modified:
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/orgUnitDistribution.js
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewOrgUnitDistribution.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-reporting/src/main/webapp/dhis-web-reporting/javascript/orgUnitDistribution.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/orgUnitDistribution.js	2012-05-01 13:14:33 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/orgUnitDistribution.js	2012-07-26 08:12:17 +0000
@@ -8,6 +8,8 @@
         return false;
     }
 
+    $('#reportButton').attr('disabled', true);
+
     displayDiv( "loaderDiv", distributionDivs );
 
     var groupSetId = $( "#groupSetId" ).val();
@@ -16,6 +18,8 @@
     {
         displayDiv( "tableDiv", distributionDivs );
         setTableStyles();
+
+        $('#reportButton').removeAttr('disabled');
     } );
 }
 
@@ -26,9 +30,13 @@
         return false;
     }
 
+    $('#chartButton').attr('disabled', true);
+
     var groupSetId = $( "#groupSetId" ).val();
     var url = "getOrgUnitDistribution.action?groupSetId=" + groupSetId + "&type=" + type + "&" + getDC();
     window.location.href = url;
+
+    $('#chartButton').removeAttr('disabled');
 }
 
 function displayOrgUnitDistributionChart()

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewOrgUnitDistribution.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewOrgUnitDistribution.vm	2012-04-16 14:54:22 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewOrgUnitDistribution.vm	2012-07-26 08:12:17 +0000
@@ -21,8 +21,8 @@
 
 <tr>
 <td>
-<label>$i18n.getString( "report_organisation_unit" )</label>
-</td>
+<label>$i18n.getString( "report_organisation_unit" )</label>
+</td>
 </tr>
 
 <tr>
@@ -40,8 +40,8 @@
 #end
 </select><br><br>
 
-<input type="button" value="$i18n.getString( 'get_report' )" style="width:135px" onclick="displayOrgUnitDistribution( 'html' )" />
-<input type="button" value="$i18n.getString( 'get_chart' )" style="width:135px" onclick="displayOrgUnitDistributionChart()" /><br><br>
+<input id="reportButton" type="button" value="$i18n.getString( 'get_report' )" style="width:135px" onclick="displayOrgUnitDistribution( 'html' )" />
+<input id="chartButton" type="button" value="$i18n.getString( 'get_chart' )" style="width:135px" onclick="displayOrgUnitDistributionChart()" /><br><br>
 
 <input type="button" value="$i18n.getString( 'get_report_as_pdf' )" style="width:135px" onclick="getOrgUnitDistribution( 'pdf' )" />
 <input type="button" value="$i18n.getString( 'get_report_as_xls' )" style="width:135px" onclick="getOrgUnitDistribution( 'xls' )" /><br>