← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4345: Fixed bug

 

------------------------------------------------------------
revno: 4345
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-08-18 10:31:15 +0200
message:
  Fixed bug
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.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-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-08-18 07:55:27 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-08-18 08:31:15 +0000
@@ -65,7 +65,7 @@
     } );
 
     $( document ).bind( 'dhis2.online', function( event, loggedIn ) {
-        if( loggedIn ) {
+        if ( loggedIn ) {
             if( isHeaderMessageVisible() ) {
                 updateHeaderMessage( i18n_online_notification );
             } else {
@@ -73,7 +73,7 @@
             }
         } 
         else {
-            if( isHeaderMessageVisible() ) {
+            if ( isHeaderMessageVisible() ) {
                 updateHeaderMessage( '<form style="display: inline;"><label for="username">Username</label><input name="username" id="username" type="text" size="10"/><label for="password">Password</label><input name="password" id="password" type="password" size="10"/><button id="login_button" type="button">Login</button></form>' );
                 ajax_login();
             } else {
@@ -84,7 +84,7 @@
     } );
 
     $( document ).bind( 'dhis2.offline', function() {
-        if( isHeaderMessageVisible() ) {
+        if ( isHeaderMessageVisible() ) {
             updateHeaderMessage( i18n_offline_notification );
         } else {
             setHeaderMessage( i18n_offline_notification );
@@ -147,11 +147,11 @@
             success: function( data, textStatus, jqXHR ) {
                 clearCompleteDataSetLocally(this.completeDataSet);
             }
-        });
+        } );
     }
 
     if ( oldHeaderMessage.length > 0 ) {
-        setHeaderMessage(oldHeaderMessage);
+        setHeaderMessage( oldHeaderMessage );
     } else {
         hideHeaderMessage();
     }
@@ -321,8 +321,6 @@
     var dataSetId = $( '#selectedDataSetId' ).val();
     var periodId = $( '#selectedPeriodId' ).val();
 
-//    var url = 'loadDataSets.action';
-
     $( '#selectedOrganisationUnit' ).val( organisationUnitName );
     $( '#currentOrganisationUnit' ).html( organisationUnitName );
 
@@ -1071,6 +1069,8 @@
 	{
 		var formIds = [];
 		
+		var formIndex = 0;
+		
 		for ( var i = 0; i < localStorage.length; i++ )
 		{
 			var key = localStorage.key(i);
@@ -1079,7 +1079,7 @@
 			{
 				var id = key.split( '-' )[1];
 				
-				formIds[i++] = id;
+				formIds[formIndex++] = id;
 			}
 		}
 		
@@ -1251,7 +1251,7 @@
 	    var id = this.getDataValueIdentifier( dataElementId, categoryOptionComboId, periodId, organisationUnitId );
 	    var dataValues = this.getAllDataValues();
 
-	    if( dataValues[id] != null ) 
+	    if ( dataValues[id] != null ) 
 	    {
 	        delete dataValues[id];
 	        localStorage[KEY_DATAVALUES] = JSON.stringify( dataValues );