← Back to team overview

dhis2-devs team mailing list archive

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

 

------------------------------------------------------------
revno: 8077
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-09-13 17:59:16 +0200
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	2012-09-13 07:49:41 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2012-09-13 15:59:16 +0000
@@ -414,58 +414,58 @@
 
 function enableSectionFilter()
 {
-    var $sectionsHeaders = $(".formSection .cent h3");
+    var $sectionsHeaders = $( '.formSection .cent h3' );
 
-    if( $sectionsHeaders.size() > 1)
+    if ( $sectionsHeaders.size() > 1)
     {
-        $("#selectionBox").css("height", "123px");
+        $( '#selectionBox' ).css( 'height', '123px' );
 
-        $("#filterDataSetSection").append("<option value='all'>" + i18n_show_all_sections + "</option>");
+        $( '#filterDataSetSection' ).append( "<option value='all'>" + i18n_show_all_sections + "</option>" );
 
         $sectionsHeaders.each(function(idx, value) {
-            $("#filterDataSetSection").append("<option value='" + idx + "'>" + value.innerHTML + "</option>");
+            $( '#filterDataSetSection' ).append( "<option value='" + idx + "'>" + value.innerHTML + "</option>" );
         });
 
-        $("#filterDataSetSectionTr").show();
+        $( '#filterDataSetSectionTr' ).show();
     }
     else
     {
-        $("#selectionBox").css("height", "93px");
-        $("#filterDataSetSectionTr").hide();
-        $("#filterDataSetSection").children().remove();
+        $( '#selectionBox' ).css( 'height', '93px' );
+        $( '#filterDataSetSectionTr' ).hide();
+        $( '#filterDataSetSection' ).children().remove();
     }
 }
 
 function filterOnSection()
 {
-    var $filterDataSetSection = $("#filterDataSetSection");
+    var $filterDataSetSection = $( '#filterDataSetSection' );
     var value = $filterDataSetSection.val();
 
-    if(value == 'all')
+    if ( value == 'all' )
     {
         $(".formSection").show();
     }
     else
     {
-        $(".formSection").hide();
-        $($(".formSection")[value]).show();
+        $( '.formSection' ).hide();
+        $( $( '.formSection' )[value] ).show();
     }
 }
 
 function filterInSection($this)
 {
     var $tbody = $this.parent().parent().parent();
-    var $trTarget = $tbody.find("tr:not([colspan])");
+    var $trTarget = $tbody.find( 'tr:not([colspan])' );
 
-    if($this.val() == '')
+    if( $this.val() == '' )
     {
         $trTarget.show();
     }
     else
     {
-        var $trTargetChildren = $trTarget.find('td:first-child');
-        var $matched = $trTargetChildren.find(':contains("' + $this.val() + '")');
-        var $not_matched = $trTargetChildren.find(':not(:contains("' + $this.val() + '"))');
+        var $trTargetChildren = $trTarget.find( 'td:first-child' );
+        var $matched = $trTargetChildren.find( ':contains("' + $this.val() + '")' );
+        var $not_matched = $trTargetChildren.find( ':not(:contains("' + $this.val() + '"))' );
 
         $matched.parent().parent(). show();
         $not_matched.parent().parent(). hide();