/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk
85.2.1 by a11emmjo
Combined bannermenu with startview to get correct start-page.
1
/* TODO: cHANGE THIS FILE ENTIRELY!!! CHANGE CALLED ID'S AND CLASSES */
67.1.6 by a11emmjo
Replaced bannermenu/topmenu/header... on login-page.
2
85.2.1 by a11emmjo
Combined bannermenu with startview to get correct start-page.
3
/* Functions that run when the page loads */
4
$(document).ready(function() {
90.1.2 by a11emmjo
Made a standard css-file to be used for the whole lenasys-page.
5
90.1.12 by a11emmjo
Fixed so the bannermenu is scrollable horizontally but not vertically.
6
	/* Makes the bannermenu scrollable horizontally but not vertically */
7
	$('#bannerBody').scrollToFixed();
8
90.1.8 by a11emmjo
Fixed some redirect-links.
9
	/* Sets the click-function for the usermenubutton */
90.1.2 by a11emmjo
Made a standard css-file to be used for the whole lenasys-page.
10
	$('#bannerUserMenuButton').click(function(e){
90.1.8 by a11emmjo
Fixed some redirect-links.
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')) {
90.1.12 by a11emmjo
Fixed so the bannermenu is scrollable horizontally but not vertically.
16
					// TODO: Secure that the courseblock-div is hidden when the usermenu-div is oppened.
17
					/*
90.1.9 by a11emmjo
Updated branch.
18
					if($('#dropdownMenuCourseBlock').is(':visible')) {
19
						$('#dropdownMenuCourseBlock').hide();
20
					}
21
					$('#dropdownUserMenu').load('bannermenu.php #dropdownUserMenu');
90.1.12 by a11emmjo
Fixed so the bannermenu is scrollable horizontally but not vertically.
22
					*/
90.1.8 by a11emmjo
Fixed some redirect-links.
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
		});
90.1.2 by a11emmjo
Made a standard css-file to be used for the whole lenasys-page.
43
		
44
	});
90.1.5 by a11emmjo
Added popup-div to bannermenu.
45
	
90.1.9 by a11emmjo
Updated branch.
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
		}
90.1.5 by a11emmjo
Added popup-div to bannermenu.
58
59
	});
90.1.12 by a11emmjo
Fixed so the bannermenu is scrollable horizontally but not vertically.
60
});