← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16859: Ouwt, removed block code

 

------------------------------------------------------------
revno: 16859
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-09-29 19:32:30 +0200
message:
  Ouwt, removed block code
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.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/css/widgets.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css	2014-09-28 20:57:54 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/widgets.css	2014-09-29 17:32:30 +0000
@@ -257,7 +257,7 @@
   display: inline;
   border: 0;
   padding: 0;
-  color: #5C0000;
+  color: #000;
   text-decoration: none;
   cursor: pointer;
 }

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js	2014-09-20 06:56:29 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js	2014-09-29 17:32:30 +0000
@@ -80,7 +80,6 @@
     var autoSelectRoot = true;
     var realRoot = true;
     var includeChildren = false;
-    var blockedLevels = [];
 
     this.setListenerFunction = function( listenerFunction_, skipInitialCall ) {
         listenerFunction = listenerFunction_;
@@ -92,32 +91,6 @@
         }
     };
 
-    this.addBlockedLevel = function(level) {
-        if( $.isArray(level) ) {
-            $.each(level, function(idx, item) {
-                blockedLevels.push(item);
-            });
-        } else {
-            blockedLevels.push(level);
-        }
-
-        this.updateBlockedLevels();
-    };
-
-    this.getBlockedLevels = function() {
-        return blockedLevels;
-    };
-
-    this.updateBlockedLevels = function() {
-        $('#orgUnitTree').find('a').css('color', 'black');
-
-        $.each(blockedLevels, function( idx, item ) {
-            $('#orgUnitTree li[level=' + item + '] > a').css({
-                cursor: 'not-allowed'
-            }).removeAttr('href');
-        })
-    };
-
     this.setMultipleSelectionAllowed = function( allowed ) {
         multipleSelectionAllowed = allowed;
     };
@@ -677,28 +650,9 @@
         $( "#orgUnitTree" ).show();
     };
 
-    this.unblock = function() {
-        $( "#orgUnitTree" ).unblock();
-    };
-
     this.disable = function() {
         $( "#orgUnitTree" ).hide();
     };
-
-    this.block = function( message ) {
-        if( message === undefined ) {
-            $( "#orgUnitTree" ).block( {message: null} );
-        }
-        else {
-            $( "#orgUnitTree" ).block( {
-                message: message,
-                css: {
-                    border: '1px solid black',
-                    margin: '4px 10px'
-                }
-            } );
-        }
-    };
 }
 
 // -----------------------------------------------------------------------------
@@ -790,8 +744,6 @@
         expandTreeAtOrgUnits( selected );
 
         selectOrgUnits( selected );
-
-        selection.updateBlockedLevels();
     };
 
     // force reload
@@ -872,7 +824,6 @@
         if( 'undefined' !== typeof organisationUnits[parent.c[0]] ) {
             createChildren( parentTag, parent );
             def.resolve();
-            selection.updateBlockedLevels();
         }
         else {
             selection.getOrganisationUnit( parent.c[0] ).done(function(item) {
@@ -880,13 +831,11 @@
                     $.extend( organisationUnits, item );
                     createChildren( parentTag, parent );
                     def.resolve();
-                    selection.updateBlockedLevels();
                 } else {
                     subtree.getChildren( parent.id ).done( function() {
                         createChildren( parentTag, parent );
                         def.resolve();
                     }).always(function() {
-                        selection.updateBlockedLevels();
                     });
                 }
             });