/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/bannermenu.js

  • Committer: Gustav Hatvigsson
  • Date: 2013-05-28 15:19:50 UTC
  • mfrom: (90.1.18 lenasys2)
  • Revision ID: gustav.hartvigsson@gmail.com-20130528151950-94dkhjql3y0mphyp
merged Jonsson:s changes:
Fixed even/odd line color on cmsindex.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* TODO: cHANGE THIS FILE ENTIRELY!!! CHANGE CALLED ID'S AND CLASSES */
 
2
 
 
3
/* Functions that run when the page loads */
 
4
$(document).ready(function() {
 
5
 
 
6
        /* Makes the bannermenu scrollable horizontally but not vertically */
 
7
        $('#bannerBody').scrollToFixed();
 
8
 
 
9
        /* Sets the click-function for the usermenubutton */
 
10
        $('#bannerUserMenuButton').click(function(e){
 
11
                
 
12
                $.get('ajax/isLoggedIn', function(response) {
 
13
                        if(response == 'yes') {
 
14
                                // If the user is logged in and the usermenu-div is hidden it's shown.
 
15
                                if($('#dropdownUserMenu').is(':hidden')) {
 
16
                                        // TODO: Secure that the courseblock-div is hidden when the usermenu-div is oppened.
 
17
                                        /*
 
18
                                        if($('#dropdownMenuCourseBlock').is(':visible')) {
 
19
                                                $('#dropdownMenuCourseBlock').hide();
 
20
                                        }
 
21
                                        $('#dropdownUserMenu').load('bannermenu.php #dropdownUserMenu');
 
22
                                        */
 
23
                                        $('#dropdownUserMenu').show();
 
24
                                }
 
25
                                // If the user is logged in and the usermenu-div is shown it's hidden.
 
26
                                else {
 
27
                                        $('#dropdownUserMenu').hide();
 
28
                                }
 
29
                        }
 
30
                        else {
 
31
                                // If the user is not logged in and the popup-div is hidden it's filled and shown.
 
32
                                if($('#popup').is(':hidden')) {
 
33
                                        $('#popup').load('ajax/popup/login', function(){
 
34
                                                $('#popup').show();
 
35
                                                $("#popup .hint").click(loginHint);
 
36
                                        });
 
37
                                }
 
38
                                // If the user is not logged in and the popup-div shows it's hidden.
 
39
                                else {
 
40
                                        $('#popup').hide();
 
41
                                }
 
42
                        }
 
43
                });
 
44
                
 
45
        });
 
46
        
 
47
        // TODO: Refresh the div with it's php before show.
 
48
        /* Expand and collapse courses in dropdown menu */
 
49
        $('#dropdownMenuExpandCourses').click(function(){
 
50
        
 
51
                // If the course block is collapsed it's expanded.
 
52
                if($('#dropdownMenuCourseBlock').is(':hidden')) {
 
53
                        $('#dropdownMenuCourseBlock').show();
 
54
                }
 
55
                // If the course block is expanded it's collapsed .
 
56
                else {
 
57
                        $('#dropdownMenuCourseBlock').hide();
 
58
                }
 
59
 
 
60
        });
 
61
});
 
 
b'\\ No newline at end of file'