dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #04348
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1433: Merged menu.js into main.js
------------------------------------------------------------
revno: 1433
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Mon 2010-02-15 16:01:24 +0100
message:
Merged menu.js into main.js
removed:
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/menu.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.
=== 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 2010-02-15 14:49:54 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.js 2010-02-15 15:01:24 +0000
@@ -1,4 +1,8 @@
+// -----------------------------------------------------------------------------
+// Page init
+// -----------------------------------------------------------------------------
+
$( document ).ready( function()
{
if( $( window ).width() <= 800 ) // In case of 800 x 600 screens
@@ -29,6 +33,59 @@
}
} );
+// -----------------------------------------------------------------------------
+// Menu functions
+// -----------------------------------------------------------------------------
+
+var menuTimeout = 500;
+var closeTimer = null;
+var dropDownId = null;
+
+function showDropDown( id )
+{
+ cancelHideDropDownTimeout();
+
+ var newDropDownId = "#" + id;
+
+ if ( dropDownId != newDropDownId )
+ {
+ if ( dropDownId )
+ {
+ hideDropDown();
+ }
+
+ dropDownId = newDropDownId;
+
+ $( dropDownId ).show();
+ }
+}
+
+function hideDropDown()
+{
+ $( dropDownId ).hide();
+
+ dropDownId = null;
+}
+
+function hideDropDownTimeout()
+{
+ closeTimer = window.setTimeout( hideDropDown, menuTimeout );
+}
+
+function cancelHideDropDownTimeout()
+{
+ if ( closeTimer )
+ {
+ window.clearTimeout( closeTimer );
+
+ closeTimer = null;
+ }
+}
+
+// -----------------------------------------------------------------------------
+// Leftbar
+// -----------------------------------------------------------------------------
+
var leftBar = new LeftBar();
function LeftBar()
=== 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 2010-02-04 08:29:27 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/main.vm 2010-02-15 15:01:24 +0000
@@ -19,7 +19,6 @@
<script type="text/javascript" src="../dhis-web-commons/util/lists.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="../menu.js"></script>
<script type="text/javascript">
var i18n_show_menu = '$encoder.jsEscape( $i18n.getString( "show_menu" ) , "'")';
var i18n_hide_menu = '$encoder.jsEscape( $i18n.getString( "hide_menu" ) , "'")';
=== removed file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/menu.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/menu.js 2009-03-31 11:04:20 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/menu.js 1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
-var menuTimeout = 500;
-var closeTimer = null;
-var dropDownId = null;
-
-function showDropDown( id )
-{
- cancelHideDropDownTimeout();
-
- var newDropDownId = "#" + id;
-
- if ( dropDownId != newDropDownId )
- {
- if ( dropDownId )
- {
- hideDropDown();
- }
-
- dropDownId = newDropDownId;
-
- $( dropDownId ).show();
- }
-}
-
-function hideDropDown()
-{
- $( dropDownId ).hide();
-
- dropDownId = null;
-}
-
-function hideDropDownTimeout()
-{
- closeTimer = window.setTimeout( hideDropDown, menuTimeout );
-}
-
-function cancelHideDropDownTimeout()
-{
- if ( closeTimer )
- {
- window.clearTimeout( closeTimer );
-
- closeTimer = null;
- }
-}