~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/menu.js

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
var menuTimeout = 500;
 
3
var closeTimer = null;
 
4
var dropDownId = null;
 
5
 
 
6
function showDropDown( id )
 
7
{
 
8
  cancelHideDropDownTimeout();
 
9
  
 
10
  var newDropDownId = "#" + id;
 
11
  
 
12
  if ( dropDownId != newDropDownId )
 
13
  {
 
14
    if ( dropDownId )
 
15
    {
 
16
      hideDropDown();
 
17
    }
 
18
 
 
19
    dropDownId = newDropDownId;
 
20
  
 
21
    $( dropDownId ).show( "fast" );
 
22
  }
 
23
}
 
24
 
 
25
function hideDropDown()
 
26
{
 
27
  $( dropDownId ).hide( "fast" );
 
28
  
 
29
  dropDownId = null;
 
30
}
 
31
 
 
32
function hideDropDownTimeout()
 
33
{
 
34
  closeTimer = window.setTimeout( hideDropDown, menuTimeout );
 
35
}
 
36
 
 
37
function cancelHideDropDownTimeout()
 
38
{
 
39
  if ( closeTimer )
 
40
  {
 
41
    window.clearTimeout( closeTimer );
 
42
    closeTimer = null;
 
43
  }
 
44
}