← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8790: ouwt: updated to use realRoot, will not allow unselect of a root node unless realRoot = true

 

------------------------------------------------------------
revno: 8790
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-10-31 11:15:09 +0100
message:
  ouwt: updated to use realRoot, will not allow unselect of a root node unless realRoot = true
modified:
  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/ouwt/ouwt.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js	2012-09-19 11:41:19 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js	2012-10-31 10:15:09 +0000
@@ -36,6 +36,7 @@
     var unselectAllowed = false;
     var rootUnselectAllowed = false;
     var autoSelectRoot = true;
+    var realRoot = true;
 
     this.setListenerFunction = function ( listenerFunction_, skipInitialCall )
     {
@@ -147,6 +148,7 @@
                 if ( data.indexOf( "<!DOCTYPE" ) != 0 )
                 {
                     data = JSON.parse( data );
+                    realRoot = data.realRoot;
                     should_update = update_required( data.version, data.roots );
                 }
             }, "text" ).complete(
@@ -297,6 +299,11 @@
                 {
                     return;
                 }
+
+                if( !realRoot )
+                {
+                    return;
+                }
             }
 
             if ( !!selected && $.isArray( selected ) )