Skip to content

Commit fd844c6

Browse files
committed
Merge pull request twbs#89 from karthikv/clean-up
Made JavaScript Unobtrusive and Removed Unused Class
2 parents ebfe465 + 0a34a6d commit fd844c6

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

docs/assets/js/application.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
$(document).ready(function(){
22

3+
// Google code prettify
4+
// ================
5+
6+
// cache $(window), as it is used in scroll spy logic later on
7+
var $window = $(window);
8+
9+
$window.load(function() {
10+
// prettyPrint cannot be set as the event handler to load directly; see
11+
// http://google-code-prettify.googlecode.com/svn/trunk/README.html
12+
prettyPrint();
13+
});
14+
15+
316
// scroll spy logic
417
// ================
518

619
var activeTarget,
7-
$window = $(window),
820
position = {},
921
nav = $('body > .topbar li a'),
1022
targets = nav.map(function () {
@@ -127,4 +139,4 @@ $(document).ready(function(){
127139

128140
});
129141

130-
});
142+
});

docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
3030
</head>
3131

32-
<body onload="prettyPrint();">
32+
<body>
3333

3434
<!-- Topbar
3535
================================================== -->
@@ -1383,4 +1383,4 @@ <h3>Operations and grid system</h3>
13831383
</div>
13841384

13851385
</body>
1386-
</html>
1386+
</html>

examples/hero.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
<div class="topbar">
2727
<div class="fill">
28-
<div class="container fixed">
28+
<div class="container">
2929
<h3><a href="#">Project name</a></h3>
3030
<ul>
3131
<li class="active"><a href="#">Home</a></li>
@@ -71,4 +71,4 @@ <h2>Heading</h2>
7171
</div> <!-- /container -->
7272

7373
</body>
74-
</html>
74+
</html>

0 commit comments

Comments
 (0)