source: branches/1.2/workflow/js/userinterface/orgchartPrint.js @ 1349

Revision 1349, 1.9 KB checked in by niltonneto, 15 years ago (diff)

Ticket #561 - Inclusão do módulo Workflow faltante nessa versão.

Line 
1function toggleEmployeesVisibility()
2{
3        if ($('#employeesVisibility').attr('checked'))
4                $('div.employees').show();
5        else
6                $('div.employees').hide();
7}
8
9function toggleHighlightSupervisor()
10{
11        if ($('#highlightSupervisor').attr('checked'))
12                $('p.supervisor').css('font-weight', 'bold');
13        else
14                $('p.supervisor').css('font-weight', 'normal');
15}
16
17function toggleOrgchartPathVisibility()
18{
19        if ($('#orgchartPathVisibility').attr('checked'))
20        {
21                $('span.orgchartPath').css('visibility', 'visible').show();
22        }
23        else
24        {
25                if ($('#orgchartPathIndentation').attr('checked'))
26                        $('span.orgchartPath').show().css('visibility', 'hidden');
27                else
28                        $('span.orgchartPath').hide();
29        }
30}
31
32function toggleOrgchartPathIndentation()
33{
34        if ($('#orgchartPathIndentation').attr('checked'))
35        {
36                $('div.employees').each(function()
37                        {
38                                $(this).css('margin-left', (0 + $($(this).parent().children('h1').children().get(0)).width()) + 'px');
39                        }
40                );
41                if (!$('#orgchartPathVisibility').attr('checked'))
42                        $('span.orgchartPath').show().css('visibility', 'hidden');
43        }
44        else
45        {
46                $('div.employees').css('margin-left', '0px');
47                if (!$('#orgchartPathVisibility').attr('checked'))
48                        $('span.orgchartPath').css('visibility', 'visible').hide();
49                else
50                        $('span.orgchartPath').css('visibility', 'visible');
51        }
52}
53
54function printAction()
55{
56        window.print();
57}
58
59function bindEvents()
60{
61        $('#employeesVisibility').click(toggleEmployeesVisibility);
62        $('#highlightSupervisor').click(toggleHighlightSupervisor);
63        $('#orgchartPathVisibility').click(toggleOrgchartPathVisibility);
64        $('#orgchartPathIndentation').click(toggleOrgchartPathIndentation);
65        $('#printButton').click(printAction);
66}
67
68function initialSetup()
69{
70        toggleEmployeesVisibility();
71        toggleHighlightSupervisor();
72        toggleOrgchartPathVisibility();
73        toggleOrgchartPathIndentation();
74}
75
76function pageLoad()
77{
78        bindEvents();
79        initialSetup();
80}
81
82$(window).load(pageLoad);
Note: See TracBrowser for help on using the repository browser.