/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/popup-roland.js

  • Committer: Erik Wikström
  • Date: 2013-05-22 09:37:08 UTC
  • mto: This revision was merged to the branch mainline in revision 90.
  • Revision ID: wikxen@gmail.com-20130522093708-jvvqyz03bhdd8wj4
Moved popup-code from header.js to popup-roland.js (popup.js exists). Moved popup-styles from header.css to popup.css.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
$(document).ready(function(){
 
2
        $('#passwordChanger').hide();
 
3
        
 
4
        /* Blurs body and opens password changer */
 
5
        $('li[name="changePwd"]').click(function(e){
 
6
                e.stopPropagation();
 
7
                $('#popoutMenu').stop(false, false).slideUp(300);
 
8
                popoutMenu=0;
 
9
            $('body *').not('#passwordChanger, #passwordChanger *').animate({
 
10
                opacity:0.4}, 400);
 
11
                $('#passwordChanger').fadeIn(300);
 
12
                $('#passwordChanger').css('z-index', 3000);
 
13
        });
 
14
        
 
15
        $('body').click(function(e){
 
16
                $('#formContainer').fadeOut(300);
 
17
                $('#passwordChanger').fadeOut(300);
 
18
                $('body *').animate({
 
19
                opacity:1}, 400);
 
20
                $('#changePassword')[0].reset();
 
21
        });
 
22
        
 
23
        $('#passwordChanger').click(function(e){
 
24
                e.stopPropagation();
 
25
        });
 
26
        
 
27
        $('#formContainer').click(function(e){
 
28
                e.stopPropagation();
 
29
        });
 
30
        
 
31
        $('#popoutLink').click(function(e){
 
32
                if(popoutMenu==0){
 
33
                        $('#popoutMenu').stop(false, true).slideDown(300);
 
34
                        popoutMenu=1;
 
35
                        e.stopPropagation();
 
36
                // FIXA SÅ MENYN INTE KOMMER UPP IGEN
 
37
                }
 
38
                else if(popoutMenu==1){
 
39
                        $('#popoutMenu').stop(false, false).slideUp(300);       
 
40
                        popoutMenu=0;
 
41
                        e.stopPropagation();
 
42
                }
 
43
        });
 
44
        
 
45
        $('#loginLink').click(function(e){
 
46
                var target = $('#formContainer');
 
47
                if(target.is(":hidden")){
 
48
                        target.fadeIn(300);
 
49
                        $('#username').focus();
 
50
                        e.stopPropagation();
 
51
                }
 
52
                else{
 
53
                        target.fadeOut(300);
 
54
                }
 
55
                
 
56
        });
 
57
});
 
58
 
 
59
window.onkeyup = function(event){
 
60
        if(event.keyCode==27){
 
61
                $('#formContainer').fadeOut(300);
 
62
                $('#passwordChanger').fadeOut(300);
 
63
                $('body *').animate({
 
64
                opacity:1}, 400);
 
65
                $('#changePassword')[0].reset();
 
66
        }
 
67
}
 
68
 
 
69
/* Closing password changer and reactivates body */
 
70
function cancelPasswordChange(){
 
71
        $('#passwordChanger').fadeOut(300);
 
72
        $('body *').animate({
 
73
        opacity:1}, 400);
 
74
        $('#changePassword')[0].reset();
 
75
}
 
 
b'\\ No newline at end of file'