[713] | 1 | |
---|
| 2 | function 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 | |
---|
| 36 | Event.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 | }); |
---|