/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk

« back to all changes in this revision

Viewing changes to codeigniter/js/header.js

  • Committer: a11andoh
  • Date: 2013-05-22 12:56:44 UTC
  • mfrom: (87 lenasys_b)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: a11andoh@student.his.se-20130522125644-0wkdt772nhva91kc
blurp

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
$(document).ready(function(){
7
7
        $('#expandedCourses').hide();
8
8
        $('#popoutMenu').hide();
 
9
        $('#passwordChanger').hide();
9
10
 
10
11
        /* Check courses in expanded menu */
11
12
        $('li[class="expanded"]').click(function(){
17
18
                }
18
19
        });
19
20
 
 
21
        /* Blurs body and opens password changer */
 
22
        $('li[name="changePwd"]').click(function(e){
 
23
                e.stopPropagation();
 
24
                $('#popoutMenu').stop(false, false).slideUp(300);
 
25
                popoutMenu=0;
 
26
            $('body *').not('#passwordChanger, #passwordChanger *').animate({
 
27
                opacity:0.4}, 400);
 
28
                $('#passwordChanger').fadeIn(300);
 
29
                $('#passwordChanger').css('z-index', 3000);
 
30
        });
 
31
        
 
32
        $('body').click(function(e){
 
33
                $('#formContainer').fadeOut(300);
 
34
                $('#passwordChanger').fadeOut(300);
 
35
                $('body *').animate({
 
36
                opacity:1}, 400);
 
37
                $('#changePassword')[0].reset();
 
38
        });
 
39
        
 
40
        $('#passwordChanger').click(function(e){
 
41
                e.stopPropagation();
 
42
        });
 
43
        
 
44
        $('#formContainer').click(function(e){
 
45
                e.stopPropagation();
 
46
        });
 
47
        
 
48
        $('#popoutLink').click(function(e){
 
49
                if(popoutMenu==0){
 
50
                        $('#popoutMenu').stop(false, true).slideDown(300);
 
51
                        popoutMenu=1;
 
52
                        e.stopPropagation();
 
53
                // FIXA SÅ MENYN INTE KOMMER UPP IGEN
 
54
                }
 
55
                else if(popoutMenu==1){
 
56
                        $('#popoutMenu').stop(false, false).slideUp(300);       
 
57
                        popoutMenu=0;
 
58
                        e.stopPropagation();
 
59
                }
 
60
        });
 
61
        
 
62
        $('#loginLink').click(function(e){
 
63
                var target = $('#formContainer');
 
64
                if(target.is(":hidden")){
 
65
                        target.fadeIn(300);
 
66
                        $('#username').focus();
 
67
                        e.stopPropagation();
 
68
                }
 
69
                else{
 
70
                        target.fadeOut(300);
 
71
                }
 
72
                
 
73
        });
 
74
});
 
75
 
 
76
window.onkeyup = function(event){
 
77
        if(event.keyCode==27){
 
78
                $('#formContainer').fadeOut(300);
 
79
                $('#passwordChanger').fadeOut(300);
 
80
                $('body *').animate({
 
81
                opacity:1}, 400);
 
82
                $('#changePassword')[0].reset();
 
83
        }
 
84
}
 
85
 
 
86
/* Closing password changer and reactivates body */
 
87
function cancelPasswordChange(){
 
88
        $('#passwordChanger').fadeOut(300);
 
89
        $('body *').animate({
 
90
        opacity:1}, 400);
 
91
        $('#changePassword')[0].reset();
 
92
}
 
93
 
 
94
 
20
95
/* Expand/Collapse courses in popout menu */
21
96
function expandCourses(){
22
97
        if(expandedCourses==0){