/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk
9.6.1 by Adam Ringhede
Changed structure in Code Viewer Alt
1
var menuTopOffset = 40;
9.6.2 by Adam Ringhede
Changed references and adapted to codestandard
2
var menuLeftOffset = 25;
3
4
$(document).ready(function() {
4.7.14 by Adam Ringhede
Fixes zooming related issues and makes other ui-related improvements.
5
//	window.onresize = fixMenuLeft;
9.6.2 by Adam Ringhede
Changed references and adapted to codestandard
6
	//$('#menu').offset({ top: menuTopOffset, left: $('#menu').offset().left });
7
	//window.onscroll = moveMenu;
12.4.2 by Adam Ringhede
Adds PIE for CSS3 compatability issues with IE
8
	$('#menuHeader').click(toggleMenu);/*
9
	
10
	*/
9.6.2 by Adam Ringhede
Changed references and adapted to codestandard
11
	$("a.menuLink").click(function(event) {
12
		event.preventDefault();
13
		event.stopPropagation();
14
		var destination = event.target.href.substring(event.target.href.lastIndexOf('/') + 1);
15
		scrollTo(destination);
16
	});
4.7.14 by Adam Ringhede
Fixes zooming related issues and makes other ui-related improvements.
17
	var sidebar = $('#sidebar');
18
	$(document).bind('scroll', function() {
19
		sidebar.css("top", $(window).scrollTop());
20
	});
12.4.2 by Adam Ringhede
Adds PIE for CSS3 compatability issues with IE
21
	$('.ieCSS3Fix, .menuLink').each(function() {
22
		PIE.attach(this);
23
	});
9.6.2 by Adam Ringhede
Changed references and adapted to codestandard
24
});
25
26
function fixMenuLeft(ev) {
27
	//$('#menu').offset({ top: bodyelem.scrollTop()+menuTopOffset, left: -($('#menu').width()-30) });
28
	if($('#menu').offset().left != 0) {
29
		$('#menu').offset({ top: $('#menu').offset().top, left: -($('#menu').width()-menuLeftOffset) });
30
	}
31
}
32
33
function toggleMenu(ev) {
34
	if($('#menu').offset().left == 0) {
4.7.14 by Adam Ringhede
Fixes zooming related issues and makes other ui-related improvements.
35
		$('#menu').stop().animate({ left: -($('#menu').width()-menuLeftOffset) },{duration:900});
9.6.2 by Adam Ringhede
Changed references and adapted to codestandard
36
		$("#menuArrow").addClass("rotateArrowCW");
37
	} else {
4.7.14 by Adam Ringhede
Fixes zooming related issues and makes other ui-related improvements.
38
		$('#menu').stop().animate({ left: 0 },{duration:900});
9.6.2 by Adam Ringhede
Changed references and adapted to codestandard
39
		$("#menuArrow").removeClass("rotateArrowCW");
40
	}
41
}
42
43
function moveMenu(ev){
44
	if($.browser.webkit) {
45
		bodyelem = $("body");
46
	} else {
47
		bodyelem = $("html,body");
48
	}
49
	$('#menu').offset({ top: bodyelem.scrollTop()+menuTopOffset, left: $('#menu').offset().left });
50
}
51
52
function scrollTo(id){
53
	$('html,body').animate({scrollTop: $("#"+id).offset().top},{duration:900});
54
	return false;
55
}