/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 Hartvigsson
  • Date: 2013-04-12 19:13:58 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20130412191358-lvnmll48cw7idkzk
added:
* COPYING - licensing information
* COPYRIGHT_HEADER - the header that should be in every file related to
  the project.
* README - Information about the project.
* lgpl-3.0 - The license that is used by this project.

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'