/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: a11emmjo
  • Date: 2013-05-28 08:51:26 UTC
  • mto: This revision was merged to the branch mainline in revision 110.
  • Revision ID: a11emmjo@student.his.se-20130528085126-16sx38szwbsx1coh
Changed so that cms-controller loads filetree (before known as examplesController, examplesBody, examplesMenu).

Also changed to describing filenames and names for attributes and functions in css, php-view and in model that is used for this.

Started working on cmsindex-view and -css.

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/loginForm #loginForm', function(){
 
34
                                                $('#popup').show();
 
35
                                        });
 
36
                                }
 
37
                                // If the user is not logged in and the popup-div shows it's hidden.
 
38
                                else {
 
39
                                        $('#popup').hide();
 
40
                                }
 
41
                        }
 
42
                });
 
43
                
 
44
        });
 
45
        
 
46
        // TODO: Refresh the div with it's php before show.
 
47
        /* Expand and collapse courses in dropdown menu */
 
48
        $('#dropdownMenuExpandCourses').click(function(){
 
49
        
 
50
                // If the course block is collapsed it's expanded.
 
51
                if($('#dropdownMenuCourseBlock').is(':hidden')) {
 
52
                        $('#dropdownMenuCourseBlock').show();
 
53
                }
 
54
                // If the course block is expanded it's collapsed .
 
55
                else {
 
56
                        $('#dropdownMenuCourseBlock').hide();
 
57
                }
 
58
 
 
59
        });
 
60
});
 
 
b'\\ No newline at end of file'