← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14629: Code style

 

------------------------------------------------------------
revno: 14629
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-04-03 13:02:16 +0200
message:
  Code style
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.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-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js	2013-12-19 09:19:44 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js	2014-04-03 11:02:16 +0000
@@ -16,39 +16,45 @@
 
 function SelectionTreeSelection()
 {
-  var onSelectFunction = undefined;
-
-  var listenerFunction = undefined;
-
-  var multipleSelectionAllowed = true;
-
-  this.setOnSelectFunction = function( onSelectFunction_ ) {
-    onSelectFunction = onSelectFunction_;
-  };
-
-  this.setListenerFunction = function( listenerFunction_ ) {
-    listenerFunction = listenerFunction_;
-  };
-
-  this.setMultipleSelectionAllowed = function( allowed ) {
-    multipleSelectionAllowed = allowed;
-  };
-
-  this.getSelected = function() {
-    return selectedOrganisationUnit;
-  };
-
-  this.getSelectedUid = function() {
-    return selectedOrganisationUnit;
-  }
-
-  this.isSelected = function() {
-    return selectedOrganisationUnit && selectedOrganisationUnit.length > 0;
-  }
-
-  this.select = function( unitId )
-    {
-       if ( onSelectFunction )
+    var onSelectFunction = undefined;
+
+    var listenerFunction = undefined;
+
+    var multipleSelectionAllowed = true;
+
+    this.setOnSelectFunction = function( onSelectFunction_ ) 
+    {
+        onSelectFunction = onSelectFunction_;
+    }
+
+    this.setListenerFunction = function( listenerFunction_ ) 
+    {
+        listenerFunction = listenerFunction_;
+    }
+
+    this.setMultipleSelectionAllowed = function( allowed ) 
+    {
+        multipleSelectionAllowed = allowed;
+    }
+
+    this.getSelected = function() 
+    {
+        return selectedOrganisationUnit;
+    }
+
+    this.getSelectedUid = function() 
+    {
+        return selectedOrganisationUnit;
+    }
+
+    this.isSelected = function() 
+    {
+        return selectedOrganisationUnit && selectedOrganisationUnit.length > 0;
+    }
+
+    this.select = function( unitId )
+    {
+        if ( onSelectFunction )
         {
             onSelectFunction();
         }
@@ -58,7 +64,7 @@
 
         if ( linkTags[0].className == 'selected' )
         {
-			$.post( selectionTreePath + 'removeorgunit.action', { id:unitId }, responseReceived );
+            $.post( selectionTreePath + 'removeorgunit.action', { id:unitId }, responseReceived );
 				
             linkTags[0].className = '';			
         }
@@ -68,7 +74,7 @@
             {
                 $.post( selectionTreePath + 'addorgunit.action', { id:unitId }, responseReceived );
 				
-				linkTags[0].className = 'selected';
+                linkTags[0].className = 'selected';
             }
             else
             {
@@ -93,25 +99,27 @@
 
     function responseReceived( json )
     {
-      selectedOrganisationUnit = [];
-      selectedOrganisationUnitUid = [];
-
-      var unitIds = [];
-      var unitUids = [];
-
-      for( i in json.selectedUnits ) {
-        unitIds[i] = json.selectedUnits[i].id;
-        selectedOrganisationUnit.push(unitIds[i]);
-
-        unitUids[i] = json.selectedUnits[i].uid;
-        selectedOrganisationUnitUid.push(unitUids[i]);
-      }
-
-      jQuery('body').trigger('oust.selected', selectedOrganisationUnit);
-
-      if( listenerFunction ) {
-        listenerFunction(unitIds);
-      }
+        selectedOrganisationUnit = [];
+        selectedOrganisationUnitUid = [];
+
+        var unitIds = [];
+        var unitUids = [];
+
+        for ( i in json.selectedUnits ) 
+        {
+            unitIds[i] = json.selectedUnits[i].id;
+            selectedOrganisationUnit.push(unitIds[i]);
+
+            unitUids[i] = json.selectedUnits[i].uid;
+            selectedOrganisationUnitUid.push(unitUids[i]);
+        }
+
+        jQuery('body').trigger('oust.selected', selectedOrganisationUnit);
+
+        if ( listenerFunction ) 
+        {
+            listenerFunction(unitIds);
+        }
     }
 
     function getTagId( unitId )

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js	2014-04-02 16:21:34 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js	2014-04-03 11:02:16 +0000
@@ -13,6 +13,11 @@
 	dhis2.appr.displayPeriods();
 }
 
+dhis2.appr.orgUnitSelected = function()
+{
+	
+}
+
 dhis2.appr.displayPeriods = function()
 {
 	var pt = $( '#dataSetId :selected' ).data( "pt" );