/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');
19.3.1 by Adam Ringhede
Fixes rounded corners, drop shadows and gradients for IE on the Code Viewer Alt index page.
18
	$(window).bind('scroll', function() {
4.7.14 by Adam Ringhede
Fixes zooming related issues and makes other ui-related improvements.
19
		sidebar.css("top", $(window).scrollTop());
20
	});
19.3.1 by Adam Ringhede
Fixes rounded corners, drop shadows and gradients for IE on the Code Viewer Alt index page.
21
	$('.ieCSS3Fix, .group h2').each(function() {
22
		if(PIE.attach) {
23
			PIE.attach(this);
24
		}
12.4.2 by Adam Ringhede
Adds PIE for CSS3 compatability issues with IE
25
	});
9.6.2 by Adam Ringhede
Changed references and adapted to codestandard
26
});
27
28
function fixMenuLeft(ev) {
29
	//$('#menu').offset({ top: bodyelem.scrollTop()+menuTopOffset, left: -($('#menu').width()-30) });
30
	if($('#menu').offset().left != 0) {
31
		$('#menu').offset({ top: $('#menu').offset().top, left: -($('#menu').width()-menuLeftOffset) });
32
	}
33
}
34
35
function toggleMenu(ev) {
36
	if($('#menu').offset().left == 0) {
4.7.14 by Adam Ringhede
Fixes zooming related issues and makes other ui-related improvements.
37
		$('#menu').stop().animate({ left: -($('#menu').width()-menuLeftOffset) },{duration:900});
9.6.2 by Adam Ringhede
Changed references and adapted to codestandard
38
		$("#menuArrow").addClass("rotateArrowCW");
39
	} else {
4.7.14 by Adam Ringhede
Fixes zooming related issues and makes other ui-related improvements.
40
		$('#menu').stop().animate({ left: 0 },{duration:900});
9.6.2 by Adam Ringhede
Changed references and adapted to codestandard
41
		$("#menuArrow").removeClass("rotateArrowCW");
42
	}
43
}
44
45
function moveMenu(ev){
46
	if($.browser.webkit) {
47
		bodyelem = $("body");
48
	} else {
49
		bodyelem = $("html,body");
50
	}
51
	$('#menu').offset({ top: bodyelem.scrollTop()+menuTopOffset, left: $('#menu').offset().left });
52
}
53
54
function scrollTo(id){
55
	$('html,body').animate({scrollTop: $("#"+id).offset().top},{duration:900});
56
	return false;
57
}