← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7197: Using css instead of js for the hover/click effect on top menu. Makes it load faster and easier t...

 

------------------------------------------------------------
revno: 7197
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-06-05 21:47:24 +0200
message:
  Using css instead of js for the hover/click effect on top menu. Makes it load faster and easier to open a module in a new tab.
modified:
  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/green.css
  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/india.css
  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/light_blue.css
  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/vietnam.css
  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
=== modified 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-05-02 15:08:10 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/dom.js	2012-06-05 19:47:24 +0000
@@ -1,16 +1,6 @@
 
 $( document ).ready( function()
-{        
-  $( "li.menuDropDownItem" ).mouseover( function() // Over dropdown item
-  {
-    $( this ).css( "background-color", "#679a6d" );
-  });
-  
-  $( "li.menuDropDownItem" ).mouseout( function() // Out dropdown item
-  {
-    $( this ).css( "background-color", "#4a6f4d" );
-  });
-  
+{
   $( "li.introItem" ).mouseover( function() // Over intro item
   {
     $( this ).css( "background-color", "#9dc69c" );

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css	2012-06-04 12:27:36 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/green/green.css	2012-06-05 19:47:24 +0000
@@ -191,30 +191,30 @@
   border-bottom-right-radius: 3px;
 }
 
-.menuDropDownArea a
-{
-  color: #ffffff;
-}
-
-.menuDropDownArea a:hover
-{
-  text-decoration: none;
-}
-
 .menuDropDownBox
 {
-  list-style-type:none;
-  margin-left: 0;
+  list-style-type: none;
+  padding: 0;
+  margin: 10px 0;
 }
 
-.menuDropDownItem
+.menuDropDownBox a
 {
-  padding-top: 6px;
+  display: block;
+  width: 169px;
+  padding-top: 8px;
   padding-left: 10px;
-  padding-bottom: 5px;
+  padding-bottom: 7px;
   padding-right: 10px;
+  color: #ffffff;
+  border-radius: 3px;
   cursor: pointer;
-  border-radius: 3px;
+}
+
+.menuDropDownBox a:hover
+{
+  text-decoration: none;
+  background-color: #679a6d;
 }
 
 /*----------------------------------------------------------------------------*/

=== modified 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	2010-07-01 03:25:19 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/dom.js	2012-06-05 19:47:24 +0000
@@ -1,18 +1,6 @@
 
 $( document ).ready( function()
-{        
-  $( "li.menuDropDownItem" ).mouseover( function() // Over dropdown item
-  {
-    $( this ).css( "background-color", "#f5790b" );
-    $( this ).css( "border", "1px solid #ffffff" );
-  });
-  
-  $( "li.menuDropDownItem" ).mouseout( function() // Out dropdown item
-  {
-    $( this ).css( "background-color", "#518a0f" );
-    $( this ).css( "border", "1px solid #518a0f" );
-  });
-  
+{
   $( "li.introItem" ).mouseover( function() // Over intro item
   {
     $( this ).css( "background-color", "#a4d2a3" );

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css	2012-06-04 12:27:36 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/india/india.css	2012-06-05 19:47:24 +0000
@@ -212,31 +212,30 @@
   border-bottom-right-radius: 3px;
 }
 
-.menuDropDownArea a
-{
-  color: #ffffff;
-}
-
-.menuDropDownArea a:hover
-{
-  text-decoration: none;
-}
-
 .menuDropDownBox
 {
-  list-style-type:none;
-  margin-left: 0;
+  list-style-type: none;
+  padding: 0;
+  margin: 10px 0;
 }
 
-.menuDropDownItem
+.menuDropDownBox a
 {
-  padding-top: 5px;
+  display: block;
+  width: 169px;
+  padding-top: 8px;
   padding-left: 10px;
-  padding-bottom: 4px;
+  padding-bottom: 7px;
   padding-right: 10px;
-  border: 1px solid #518a0f;
+  color: #ffffff;
+  border-radius: 3px;
   cursor: pointer;
-  border-radius: 3px;
+}
+
+.menuDropDownBox a:hover
+{
+  text-decoration: none;
+  background-color: #f5790b;
 }
 
 /*----------------------------------------------------------------------------*/

=== modified 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-02-20 14:25:48 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/dom.js	2012-06-05 19:47:24 +0000
@@ -1,16 +1,6 @@
 
 $( document ).ready( function()
-{        
-  $( "li.menuDropDownItem" ).mouseover( function() // Over dropdown item
-  {
-    $( this ).css( "background-color", "#4A89BA" );
-  });
-  
-  $( "li.menuDropDownItem" ).mouseout( function() // Out dropdown item
-  {
-    $( this ).css( "background-color", "#2a5a8a" );
-  });
-  
+{
   $( "li.introItem" ).mouseover( function() // Over intro item
   {
     $( this ).css( "background-color", "#a4d2a3" );

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css	2012-06-04 12:27:36 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/light_blue/light_blue.css	2012-06-05 19:47:24 +0000
@@ -191,30 +191,30 @@
   border-bottom-right-radius: 3px;
 }
 
-.menuDropDownArea a
-{
-  color: #ffffff;
-}
-
-.menuDropDownArea a:hover
-{
-  text-decoration: none;
-}
-
 .menuDropDownBox
 {
   list-style-type: none;
-  margin-left: 0;
+  padding: 0;
+  margin: 10px 0;
 }
 
-.menuDropDownItem
+.menuDropDownBox a
 {
+  display: block;
+  width: 169px;
   padding-top: 8px;
   padding-left: 10px;
   padding-bottom: 7px;
   padding-right: 10px;
+  color: #ffffff;
+  border-radius: 3px;
   cursor: pointer;
-  border-radius: 3px;
+}
+
+.menuDropDownBox a:hover
+{
+  text-decoration: none;
+  background-color: #4A89BA;
 }
 
 /*----------------------------------------------------------------------------*/

=== modified 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-02-20 14:49:55 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/dom.js	2012-06-05 19:47:24 +0000
@@ -1,16 +1,6 @@
 
 $( document ).ready( function()
-{        
-  $( "li.menuDropDownItem" ).mouseover( function() // Over dropdown item
-  {
-    $( this ).css( "background-color", "#cf4343" );
-  });
-  
-  $( "li.menuDropDownItem" ).mouseout( function() // Out dropdown item
-  {
-    $( this ).css( "background-color", "#b91010" );
-  });
-  
+{
   $( "li.introItem" ).mouseover( function() // Over intro item
   {
     $( this ).css( "background-color", "#a4d2a3" );

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css	2012-06-04 12:27:36 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/css/vietnam/vietnam.css	2012-06-05 19:47:24 +0000
@@ -191,30 +191,30 @@
   border-bottom-right-radius: 3px;
 }
 
-.menuDropDownArea a
-{
-  color: #ffffff;
-}
-
-.menuDropDownArea a:hover
-{
-  text-decoration: none;
-}
-
 .menuDropDownBox
 {
-  list-style-type:none;
-  margin-left: 0;
+  list-style-type: none;
+  padding: 0;
+  margin: 10px 0;
 }
 
-.menuDropDownItem
+.menuDropDownBox a
 {
-  padding-top: 6px;
+  display: block;
+  width: 169px;
+  padding-top: 8px;
   padding-left: 10px;
-  padding-bottom: 5px;
+  padding-bottom: 7px;
   padding-right: 10px;
+  color: #ffffff;
+  border-radius: 3px;
   cursor: pointer;
-  border-radius: 3px;
+}
+
+.menuDropDownBox a:hover
+{
+  text-decoration: none;
+  background-color: #cf4343;
 }
 
 /*----------------------------------------------------------------------------*/

=== 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-05-01 13:14:33 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js	2012-06-05 19:47:24 +0000
@@ -29,12 +29,7 @@
 		{
 			window.location.href = currentPath + 'help.action' + backURL;
 		});
-		
-	$( "#menuDropDownFeedBack" ).click(	function()
-		{
-			window.location.href = currentPath + 'displayFeedbackForm.action' + backURL;
-		} );
-		
+				
 	$( "#menuDropDownChangeLog" ).click( function()
 		{
 			window.location.href = currentPath + 'displayChangeLog.action' + backURL;

=== 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-06-03 20:33:54 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm	2012-06-05 19:47:24 +0000
@@ -76,8 +76,9 @@
       <ul class="menuDropDownBox">
       #foreach( $module in $maintenanceModules )
       #if( $auth.hasAccess( $module.name, "index" ) )
-        <li class="menuDropDownItem" onclick="window.location.href='${module.defaultAction}'">
-          <a href="${module.defaultAction}">$i18n.getString( $module.name )&nbsp;</a></li>
+        <li>
+          <a href="${module.defaultAction}">$i18n.getString( $module.name )&nbsp;</a>
+        </li>
       #end
       #end
       </ul>      
@@ -87,8 +88,9 @@
       <ul class="menuDropDownBox">
       #foreach( $module in $serviceModules )
       #if( $auth.hasAccess( $module.name, "index" ) )
-        <li class="menuDropDownItem" onclick="window.location.href='${module.defaultAction}'">
-          <a href="${module.defaultAction}">$i18n.getString( $module.name )&nbsp;</a></li>
+        <li>
+          <a href="${module.defaultAction}">$i18n.getString( $module.name )&nbsp;</a>
+        </li>
       #end
       #end
       </ul>      
@@ -96,13 +98,13 @@
 	  
       <div id="menuDropDown3" class="menuDropDownArea">
       <ul class="menuDropDownBox">
-        <li class="menuDropDownItem" id="menuDropDownHelpCenter">$i18n.getString( "help_center" )&nbsp;</li>
-        <li class="menuDropDownItem" id="menuDropDownChangeLog">$i18n.getString( "change_log" )&nbsp;</li>
-        <li class="menuDropDownItem" id="menuDropDownSupportiveSoftware">$i18n.getString( "supportive_software" )&nbsp;</li>
-        <li class="menuDropDownItem" id="menuDropDownUserAccount">$i18n.getString( "user_account" )&nbsp;</li>
-        <li class="menuDropDownItem" id="menuDropDownModuleOverview">$i18n.getString( "system_overview" )&nbsp;</li>
-        <li class="menuDropDownItem" id="menuDropDownWebApi">$i18n.getString( "web_api" )&nbsp;</li>
-        <li class="menuDropDownItem" id="menuDropDownAboutDHIS2">$i18n.getString( "about_dhis2" )&nbsp;</li>
+        <li><a id="menuDropDownHelpCenter">$i18n.getString( "help_center" )&nbsp;</a></li>
+        <li><a id="menuDropDownChangeLog">$i18n.getString( "change_log" )&nbsp;</a></li>
+        <li><a id="menuDropDownSupportiveSoftware">$i18n.getString( "supportive_software" )&nbsp;</a></li>
+        <li><a id="menuDropDownUserAccount">$i18n.getString( "user_account" )&nbsp;</a></li>
+        <li><a id="menuDropDownModuleOverview">$i18n.getString( "system_overview" )&nbsp;</a></li>
+        <li><a id="menuDropDownWebApi">$i18n.getString( "web_api" )&nbsp;</a></li>
+        <li><a id="menuDropDownAboutDHIS2">$i18n.getString( "about_dhis2" )&nbsp;</a></li>
       </ul>
       </div>