← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17567: Data entry, check for falsy rather than empty strign

 

------------------------------------------------------------
revno: 17567
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-11-24 12:04:59 +0100
message:
  Data entry, check for falsy rather than empty strign
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js
  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/entry.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js	2014-10-17 08:09:26 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js	2014-11-24 11:04:59 +0000
@@ -151,7 +151,8 @@
 function saveVal( dataElementId, optionComboId, fieldId, feedbackId )
 {
 	var fieldIds = fieldId.split( "-" );
-  feedbackId = '#' + (feedbackId || fieldId);
+
+	feedbackId = '#' + ( feedbackId || fieldId );
 
 	if ( fieldIds.length > 3 )
 	{
@@ -168,16 +169,11 @@
 
     var periodId = $( '#selectedPeriodId' ).val();
 
-	if ( value == null )
-	{
-		value = '';
-	}
-
 	var warning = undefined;
 
 	var existing = !!( dhis2.de.currentExistingValue && dhis2.de.currentExistingValue != '' );
 	
-    if ( value != '' )
+    if ( value )
     {
         if ( type == 'string' || type == 'int' || type == 'number' || type == 'posInt' || type == 'negInt' || type == 'zeroPositiveInt' || type == 'unitInterval' || type == 'percentage' )
         {

=== 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	2014-11-19 12:17:41 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2014-11-24 11:04:59 +0000
@@ -607,7 +607,8 @@
         
         $( this ).css( "cursor", "pointer" );
         
-        $( this ).click ( function() {
+        $( this ).click ( function() 
+        {
         	viewHist( dataElementId, optionComboId );
         } );
     } );