1
/* TODO: cHANGE THIS FILE ENTIRELY!!! CHANGE CALLED ID'S AND CLASSES */
3
/* Functions that run when the page loads */
4
$(document).ready(function() {
6
/* Makes the bannermenu scrollable horizontally but not vertically */
7
$('#bannerBody').scrollToFixed();
9
/* Sets the click-function for the usermenubutton */
10
$('#bannerUserMenuButton').click(function(e){
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.
18
if($('#dropdownMenuCourseBlock').is(':visible')) {
19
$('#dropdownMenuCourseBlock').hide();
21
$('#dropdownUserMenu').load('bannermenu.php #dropdownUserMenu');
23
$('#dropdownUserMenu').show();
25
// If the user is logged in and the usermenu-div is shown it's hidden.
27
$('#dropdownUserMenu').hide();
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(){
35
$("#popup .hint").click(loginHint);
38
// If the user is not logged in and the popup-div shows it's hidden.
47
// TODO: Refresh the div with it's php before show.
48
/* Expand and collapse courses in dropdown menu */
49
$('#dropdownMenuExpandCourses').click(function(){
51
// If the course block is collapsed it's expanded.
52
if($('#dropdownMenuCourseBlock').is(':hidden')) {
53
$('#dropdownMenuCourseBlock').show();
55
// If the course block is expanded it's collapsed .
57
$('#dropdownMenuCourseBlock').hide();
b'\\ No newline at end of file'