From 0a34a6d4b2131d28ed3d09857c2ccf78f139f837 Mon Sep 17 00:00:00 2001 From: Karthik Viswanathan Date: Fri, 26 Aug 2011 00:00:05 -0700 Subject: Made JavaScript unobtrusive by factoring out prettyPrint() to application.js. Also removed unused class from hero demo. --- docs/assets/js/application.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'docs/assets') diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index 3319e607d..ddf6b7b9a 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -1,10 +1,22 @@ $(document).ready(function(){ + // Google code prettify + // ================ + + // cache $(window), as it is used in scroll spy logic later on + var $window = $(window); + + $window.load(function() { + // prettyPrint cannot be set as the event handler to load directly; see + // http://google-code-prettify.googlecode.com/svn/trunk/README.html + prettyPrint(); + }); + + // scroll spy logic // ================ var activeTarget, - $window = $(window), position = {}, nav = $('body > .topbar li a'), targets = nav.map(function () { @@ -127,4 +139,4 @@ $(document).ready(function(){ }); -}); \ No newline at end of file +}); -- cgit v1.2.3