/lenasys/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/trunk

« back to all changes in this revision

Viewing changes to Code Viewer Alt/index.js

  • Committer: Gustav Hatvigsson
  • Date: 2013-05-30 12:02:31 UTC
  • mfrom: (85.1.28 lenasys)
  • Revision ID: gustav.hartvigsson@gmail.com-20130530120231-ttqgqjqw2w8enn7g
Merged Ohlsons changes:
added function to get ssn and name for the registrationspages in the user model.
added the registrationpage for students.
edited the registration page for instructors
edited the css for both the registrationpages
minor fix to registration css

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
var menuTopOffset = 40;
2
 
var menuLeftOffset = 25;
3
 
 
4
 
$(document).ready(function() {
5
 
        window.onresize = fixMenuLeft;
6
 
        //$('#menu').offset({ top: menuTopOffset, left: $('#menu').offset().left });
7
 
        //window.onscroll = moveMenu;
8
 
        $('#menuHeader').click(toggleMenu);
9
 
        $("a.menuLink").click(function(event) {
10
 
                event.preventDefault();
11
 
                event.stopPropagation();
12
 
                var destination = event.target.href.substring(event.target.href.lastIndexOf('/') + 1);
13
 
                scrollTo(destination);
14
 
        });
15
 
});
16
 
 
17
 
function fixMenuLeft(ev) {
18
 
        //$('#menu').offset({ top: bodyelem.scrollTop()+menuTopOffset, left: -($('#menu').width()-30) });
19
 
        if($('#menu').offset().left != 0) {
20
 
                $('#menu').offset({ top: $('#menu').offset().top, left: -($('#menu').width()-menuLeftOffset) });
21
 
        }
22
 
}
23
 
 
24
 
function toggleMenu(ev) {
25
 
        if($('#menu').offset().left == 0) {
26
 
                $('#menu').animate({ left: -($('#menu').width()-menuLeftOffset) },{duration:900});
27
 
                $("#menuArrow").addClass("rotateArrowCW");
28
 
        } else {
29
 
                $('#menu').animate({ left: 0 },{duration:900});
30
 
                $("#menuArrow").removeClass("rotateArrowCW");
31
 
        }
32
 
}
33
 
 
34
 
function moveMenu(ev){
35
 
        if($.browser.webkit) {
36
 
                bodyelem = $("body");
37
 
        } else {
38
 
                bodyelem = $("html,body");
39
 
        }
40
 
        $('#menu').offset({ top: bodyelem.scrollTop()+menuTopOffset, left: $('#menu').offset().left });
41
 
}
42
 
 
43
 
function scrollTo(id){
44
 
        $('html,body').animate({scrollTop: $("#"+id).offset().top},{duration:900});
45
 
        return false;
46
 
}
 
 
b'\\ No newline at end of file'