source: trunk/web-app/js/taskQuickSearchPane.js @ 728

Last change on this file since 728 was 713, checked in by gav, 14 years ago

Dynamic task quick search feature.

File size: 1.6 KB
Line 
1
2function updateQuickSearchSelection() {
3    var personsTasksSelectionIds = ['personLabel', 'personSelection', 'completedLabel', 'completedSelection'];
4    var helpBalloonSpanIds = ['allTasksHelp', 'budgetPlannedHelp', 'budgetUnplannedHelp', 'personsTasksHelp', 'personsImmediateCalloutsHelp'];
5    var val = $("quickSearchSelect").value;
6
7    $A(HelpBalloon._balloons).invoke('hide'); // Hide any open balloons.
8    helpBalloonSpanIds.each(Element.hide); // Hide all help icons.
9
10    switch(val)
11    {
12        case 'allTasks':
13            showUtil('allTasksHelp');
14            hideArrayUtil(personsTasksSelectionIds);
15            break;
16        case 'budgetPlanned':
17            showUtil('budgetPlannedHelp');
18            hideArrayUtil(personsTasksSelectionIds);
19            break;
20        case 'budgetUnplanned':
21            showUtil('budgetUnplannedHelp');
22            hideArrayUtil(personsTasksSelectionIds);
23            break;
24        case 'personsTasks':
25            showUtil('personsTasksHelp');
26            showArrayUtil(personsTasksSelectionIds);
27            break;
28        case 'personsImmediateCallouts':
29            showUtil('personsImmediateCalloutsHelp');
30            showArrayUtil(personsTasksSelectionIds);
31            break;
32    }
33
34}
35
36Event.observe(window, 'load', function() {
37    updateQuickSearchSelection(); // Initial page load.
38    $A(HelpBalloon._balloons).invoke('show'); // Work around for offset balloon when using a pane in IE.
39    $A(HelpBalloon._balloons).invoke('hide'); // Work around for offset balloon when using a pane in IE.
40    $("quickSearchSelect").observe('change', updateQuickSearchSelection); // Register onchange handler.
41});
Note: See TracBrowser for help on using the repository browser.