diff options
| author | Karthik Viswanathan <[email protected]> | 2011-08-26 00:00:05 -0700 |
|---|---|---|
| committer | Karthik Viswanathan <[email protected]> | 2011-08-26 00:00:05 -0700 |
| commit | 0a34a6d4b2131d28ed3d09857c2ccf78f139f837 (patch) | |
| tree | c4cf787d17c1dd247afd270e3f2d31bcaa6920f3 | |
| parent | cf47ef0b2eb737e00d37b41ae545fbfbf10c6196 (diff) | |
| download | bootstrap-0a34a6d4b2131d28ed3d09857c2ccf78f139f837.tar.xz bootstrap-0a34a6d4b2131d28ed3d09857c2ccf78f139f837.zip | |
Made JavaScript unobtrusive by factoring out prettyPrint() to application.js. Also removed unused class from hero demo.
| -rw-r--r-- | docs/assets/js/application.js | 16 | ||||
| -rw-r--r-- | docs/index.html | 4 | ||||
| -rw-r--r-- | examples/hero.html | 4 |
3 files changed, 18 insertions, 6 deletions
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 +}); diff --git a/docs/index.html b/docs/index.html index 58be9e8b5..be77950e7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -29,7 +29,7 @@ <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png"> </head> - <body onload="prettyPrint();"> + <body> <!-- Topbar ================================================== --> @@ -1383,4 +1383,4 @@ Lorem ipsum dolar sit amet illo error <a href="#" title="below">ipsum</a> verita </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/examples/hero.html b/examples/hero.html index faac6ab75..6841cfd39 100644 --- a/examples/hero.html +++ b/examples/hero.html @@ -25,7 +25,7 @@ <div class="topbar"> <div class="fill"> - <div class="container fixed"> + <div class="container"> <h3><a href="#">Project name</a></h3> <ul> <li class="active"><a href="#">Home</a></li> @@ -71,4 +71,4 @@ </div> <!-- /container --> </body> -</html>
\ No newline at end of file +</html> |
