← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8514: Replaced the hide left menu js function with css

 

------------------------------------------------------------
revno: 8514
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-10-12 18:37:02 +0200
message:
  Replaced the hide left menu js function with css
removed:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/dom.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/dom.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/dom.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/dom.js
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm


--
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
=== removed file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/dom.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/dom.js	2012-10-12 16:21:05 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/dom.js	1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
-
-// Called from main/Leftbar
-function setMainPageNormal()
-{
-	document.getElementById( 'mainPage' ).style.marginLeft = '270px';
-}

=== removed file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/dom.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/dom.js	2012-10-12 16:21:05 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/dom.js	1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
-
-// Called from main/Leftbar
-function setMainPageNormal()
-{
-	document.getElementById( 'mainPage' ).style.marginLeft = '300px';
-}

=== removed file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/dom.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/dom.js	2012-10-12 16:21:05 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/dom.js	1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
-
-// Called from main/Leftbar
-function setMainPageNormal()
-{
-	document.getElementById( 'mainPage' ).style.marginLeft = '270px';
-}

=== removed file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/dom.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/dom.js	2012-10-12 16:21:05 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/dom.js	1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
-
-// Called from main/Leftbar
-function setMainPageNormal()
-{
-	document.getElementById( 'mainPage' ).style.marginLeft = '270px';
-}

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js	2012-10-11 16:41:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js	2012-10-12 16:37:02 +0000
@@ -168,33 +168,28 @@
 {    
     this.showAnimated = function()
     {
-        setMenuVisible();        
-        setMainPageNormal( '270px' ); // Delegated to dom.js for each style
-        $( 'div#leftBar' ).show( 'fast' );
-        $( 'span#showLeftBar' ).hide( 'fast' );
+        setMenuVisible();
+        $( '#mainPage' ).removeAttr( 'style' );
+        $( '#leftBar' ).show( 'fast' );
+        $( '#showLeftBar' ).hide( 'fast' );
     };
     
     this.hideAnimated = function()
     {
         setMenuHidden();
-        setMainPageFullscreen( '20px' );
-        $( 'div#leftBar' ).hide( 'fast' );
-        $( 'span#showLeftBar' ).show( 'fast' );
+        $( '#mainPage' ).attr( 'style', 'margin-left:20px' );
+        $( '#leftBar' ).hide( 'fast' );
+        $( '#showLeftBar' ).show( 'fast' );
     };
     
     this.hide = function()
     {
         setMenuHidden();
-        setMainPageFullscreen( '20px' );
+        $( '#mainPage' ).attr( 'style', 'margin-left:20px' );
         document.getElementById( 'leftBar' ).style.display = 'none';
         document.getElementById( 'showLeftBar' ).style.display = 'block';
     };
 
-	function setMainPageFullscreen()
-	{
-		document.getElementById( 'mainPage' ).style.marginLeft = '20px';
-	}
-
     function setMenuVisible()
     {
         $.get( '../dhis-web-commons/menu/setMenuVisible.action' );        
@@ -207,6 +202,6 @@
     
     this.openHelpForm = function( id )
     {
-		window.open ("../dhis-web-commons/help/viewDynamicHelp.action?id=" + id,"Help", 'width=800,height=600,scrollbars=yes');
-    };
+		window.open( "../dhis-web-commons/help/viewDynamicHelp.action?id=" + id, "Help", "width=800,height=600,scrollbars=yes" );
+    }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm	2012-10-11 16:23:03 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm	2012-10-12 16:37:02 +0000
@@ -45,7 +45,6 @@
     <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.select.js"></script>
     <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.comparator.js"></script>
     <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.availability.js"></script>
-    <script type="text/javascript" src="../dhis-web-commons/css/${stylesheetDirectory}/dom.js"></script>		
     <script type="text/javascript" src="../main.js"></script>  
     <script type="text/javascript" src="../request.js"></script>
     #foreach( $javascript in $javascripts )
@@ -150,7 +149,7 @@
         
     <div id="headerMessage" class="bold"></div>
         
-    <div class="page" id="mainPage">
+    <div class="page" id="mainPage"> <!-- Do not set style attr -->
       #if( !$page )
         <p>$i18n.getString( "no_page_specified" )</p>
       #else