← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18697: Data entry, code style

 

------------------------------------------------------------
revno: 18697
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-03-26 19:16:59 +0100
message:
  Data entry, code style
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	2015-03-19 12:24:51 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2015-03-26 18:16:59 +0000
@@ -453,7 +453,7 @@
 	                setHeaderMessage( message );
 
 	                $( '#sync_button' ).bind( 'click', dhis2.de.uploadLocalData );
-                  $( '#discard_button' ).bind( 'click', dhis2.de.discardLocalData );
+                    $( '#discard_button' ).bind( 'click', dhis2.de.discardLocalData );
             	}
             }
         } );
@@ -466,16 +466,14 @@
     {
         var id = $( this ).attr( 'id' );
 
-        // if entryfield is a datepicker, remove old target field, and change id
-        if( /-dp$/.test(id) ) {
-          var dpTargetId = id.substring(0, id.length - 3);
-          $('#' + dpTargetId).remove();
-
-          $( this )
-            .attr('id', dpTargetId)
-            .calendarsPicker('destroy');
-
-          id = dpTargetId;
+        // If entry field is a date picker, remove old target field, and change id
+        
+        if ( /-dp$/.test( id ) ) 
+        {
+            var dpTargetId = id.substring( 0, id.length - 3 );
+            $( '#' + dpTargetId ).remove();
+            $( this ).attr( 'id', dpTargetId ).calendarsPicker( 'destroy' );
+            id = dpTargetId;
         }
 
         var split = dhis2.de.splitFieldId( id );