3
3
/* Functions that run when the page loads */
4
4
$(document).ready(function() {
6
/* Makes the bannermenu scrollable horizontally but not vertically */
7
$('#bannerBody').scrollToFixed();
6
9
/* Sets the click-function for the usermenubutton */
7
10
$('#bannerUserMenuButton').click(function(e){
10
13
if(response == 'yes') {
11
14
// If the user is logged in and the usermenu-div is hidden it's shown.
12
15
if($('#dropdownUserMenu').is(':hidden')) {
13
// Secure that the courseblock-div is hidden when the usermenu-div is oppened.
16
// TODO: Secure that the courseblock-div is hidden when the usermenu-div is oppened.
14
18
if($('#dropdownMenuCourseBlock').is(':visible')) {
15
19
$('#dropdownMenuCourseBlock').hide();
17
21
$('#dropdownUserMenu').load('bannermenu.php #dropdownUserMenu');
18
23
$('#dropdownUserMenu').show();
20
25
// If the user is logged in and the usermenu-div is shown it's hidden.
57
/* ROLLES KOD NEDAN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
59
/* TODO: SHOULD OPEN A POPUP VIA AJAX */
60
/* Blurs body and opens password changer */
61
$('li[name="changePwd"]').click(function(e){
63
$('#popoutMenu').stop(false, false).slideUp(300);
65
$('body *').not('#passwordChanger, #passwordChanger *').animate({
67
$('#passwordChanger').fadeIn(300);
68
$('#passwordChanger').css('z-index', 3000);
71
$('body').click(function(e){
72
$('#formContainer').fadeOut(300);
73
$('#passwordChanger').fadeOut(300);
76
$('#changePassword')[0].reset();
79
$('#passwordChanger').click(function(e){
83
$('#formContainer').click(function(e){
87
$('#popoutLink').click(function(e){
89
$('#popoutMenu').stop(false, true).slideDown(300);
92
// FIXA SÅ MENYN INTE KOMMER UPP IGEN
94
else if(popoutMenu==1){
95
$('#popoutMenu').stop(false, false).slideUp(300);
104
/* TODO: Do I need these? */
105
/* Global variables */
107
var expandedCourses=0;
109
window.onkeyup = function(event){
110
if(event.keyCode==27){
111
$('#formContainer').fadeOut(300);
112
$('#passwordChanger').fadeOut(300);
113
$('body *').animate({
115
$('#changePassword')[0].reset();
119
/* Closing password changer and reactivates body */
120
function cancelPasswordChange(){
121
$('#passwordChanger').fadeOut(300);
122
$('body *').animate({
124
$('#changePassword')[0].reset();
128
/* Expand/Collapse courses in popout menu */
129
function expandCourses(){
130
if(expandedCourses==0){
131
$('#expandedCourses').stop(false, true).slideDown(300);
134
else if(expandedCourses==1){
135
$('#expandedCourses').stop(false, false).slideUp(300);
b'\\ No newline at end of file'