From d393a503e604a288c0eee1f98e42b721e329ac76 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Thu, 10 May 2012 21:19:24 -0400 Subject: [PATCH] Remove unused JavaScript on the page bottom --- templates/coffee/src/modules/sequence.coffee | 6 +++++- templates/courseware.html | 6 ++---- templates/main.html | 2 -- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/coffee/src/modules/sequence.coffee b/templates/coffee/src/modules/sequence.coffee index 42e9cde71f..9c1549ff78 100644 --- a/templates/coffee/src/modules/sequence.coffee +++ b/templates/coffee/src/modules/sequence.coffee @@ -11,9 +11,10 @@ class @Sequence bind: -> @element.bind 'contentChanged', @toggleArrows @$('#sequence-list a').click @goto + @$('.sequence-nav li a').hover @navHover buildNavigation: -> - $.each @elements, (index, item) -> + $.each @elements, (index, item) => link = $('').attr class: "seq_#{item.type}_inactive", 'data-element': index + 1 title = $('

').html(item.title) list_item = $('

  • ').append(link.append(title)) @@ -45,6 +46,9 @@ class @Sequence @position = new_position @element.trigger 'contentChanged' + navHover: (event) => + $(event.target).siblings().toggleClass("shown") + goto: (event) => event.preventDefault() new_position = $(event.target).data('element') diff --git a/templates/courseware.html b/templates/courseware.html index ca74d843a8..2b53eaa3a0 100644 --- a/templates/courseware.html +++ b/templates/courseware.html @@ -7,12 +7,10 @@ <%block name="js_extra"> -##Is there a reason this isn't in header_extra? Is it important that the javascript is at the bottom of the generated document? diff --git a/templates/main.html b/templates/main.html index 0a3424a053..00abe2902d 100644 --- a/templates/main.html +++ b/templates/main.html @@ -113,7 +113,6 @@ - @@ -121,7 +120,6 @@ document.write('\x3Cscript type="text/javascript" src="' + document.location.protocol + '//www.youtube.com/player_api">\x3C/script>'); - <%block name="js_extra"/>