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

« back to all changes in this revision

Viewing changes to dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/reportConfiguration.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
function homeChanged()
 
3
{
 
4
        var homeField = document.getElementById( "home" );
 
5
        var directoryField = document.getElementById( "directory" );
 
6
        
 
7
        var homeValue = homeField.value;
 
8
        
 
9
        var index = homeValue.lastIndexOf( "/" );
 
10
        
 
11
        if ( index == -1 )
 
12
        {
 
13
                index = homeValue.lastIndexOf( "\\" );
 
14
        }
 
15
        
 
16
        if ( index != -1 )
 
17
        {
 
18
           var defaultDirectory = homeValue.substring( index + 1 );
 
19
           
 
20
           directoryField.value = defaultDirectory;
 
21
        }
 
22
}