/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-05-26 19:50:03 UTC
  • mfrom: (90.1.9 lenasys2)
  • Revision ID: gustav.hartvigsson@gmail.com-20130526195003-pjsuxv24fyh2cezt
Merged Jonsson:s branch:


    Updated branch.

    Updated getActiveCourse in user-model, and fixed so bannermenu- and cms-view uses it.
    Removed links from bannermenu-view.
    Fixed so cms is loaded in home-controller when user is logged in.
    Added function for expand collapse courses in bannermenu-view.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
                        if(response == 'yes') {
11
11
                                // If the user is logged in and the usermenu-div is hidden it's shown.
12
12
                                if($('#dropdownUserMenu').is(':hidden')) {
 
13
                                        // Secure that the courseblock-div is hidden when the usermenu-div is oppened.
 
14
                                        if($('#dropdownMenuCourseBlock').is(':visible')) {
 
15
                                                $('#dropdownMenuCourseBlock').hide();
 
16
                                        }
 
17
                                        $('#dropdownUserMenu').load('bannermenu.php #dropdownUserMenu');
13
18
                                        $('#dropdownUserMenu').show();
14
19
                                }
15
20
                                // If the user is logged in and the usermenu-div is shown it's hidden.
30
35
                                }
31
36
                        }
32
37
                });
33
 
        
34
 
                
35
 
                
36
 
                
37
 
 
38
 
                /*var target = $('#loginPopup');
39
 
                if(target.is(":hidden")){
40
 
                        target.fadeIn(300);
41
 
                        $('#username').focus();
42
 
                        e.stopPropagation();
43
 
                }
44
 
                else{
45
 
                        // make not visible
46
 
                        // remove from DOM
47
 
                        target.fadeOut(300);
48
 
                }*/
49
38
                
50
39
        });
51
40
        
52
 
        /* Check courses in expanded menu */
53
 
        $('li.dropdownMenuCourseBlockNonActiveCourse').click(function(){
54
 
                $('li.dropdownMenuCourseBlockActiveCourse').addClass('dropdownMenuCourseBlockNonActiveCourse');
55
 
                $('li.dropdownMenuCourseBlockActiveCourse').removeClass('dropdownMenuCourseBlockActiveCourse');
 
41
        // TODO: Refresh the div with it's php before show.
 
42
        /* Expand and collapse courses in dropdown menu */
 
43
        $('#dropdownMenuExpandCourses').click(function(){
 
44
        
 
45
                // If the course block is collapsed it's expanded.
 
46
                if($('#dropdownMenuCourseBlock').is(':hidden')) {
 
47
                        $('#dropdownMenuCourseBlock').show();
 
48
                }
 
49
                // If the course block is expanded it's collapsed .
 
50
                else {
 
51
                        $('#dropdownMenuCourseBlock').hide();
 
52
                }
56
53
 
57
 
                $(this).removeClass('dropdownMenuCourseBlockNonActiveCourse');
58
 
                $(this).addClass("dropdownMenuCourseBlockActiveCourse");
59
 
                /*TA BORT DEN ENA KLASSEN OCH ANVÄND TOGGLE*/
60
54
        });
61
55
        
62
56