Commits

shl...@13c2ddb8-3aa7-4284-800b-8db07c650eef  committed fe71198

Now the navigation controls' toggles appear in all perl-for-newbies parts.

  • Participants
  • Parent commits 4c9b56a

Comments (0)

Files changed (3)

File lib/perl-for-newbies.wml

 .page-nav-bar, .bread { display: none; }
 .page-nav-bar.vis, .bread.vis { display: block; }
 </style>
+<script type="text/javascript" src="$(ROOT)/js/toggle-nav-controls.js"></script>
 </page_extra_head_elements>
 
+<p>
+<a id="toggle_nav_control" 
+href="javascript:toggle_nav_control()" 
+class="toggle_nav_control off">Show Navigation Controls</a>
+</p>
+
 <:{
 {
     use strict;

File src/js/toggle-nav-controls.js

+function toggle_nav_control() {
+    var elem = $("#toggle_nav_control");
+
+    if (elem.hasClass("off")) {
+        elem.text("Hide Navigation Controls");
+    }
+    else {
+        elem.text("Show Navigation Controls");
+    }
+    $(".page-nav-bar, .bread").toggleClass("vis");
+    elem.toggleClass("off");
+    elem.toggleClass("on");
+}

File src/tutorials/perl-for-newbies/part1/index.html.wml

 #include '../template.wml'
 #include "perl-for-newbies.wml"
 
-<script type="text/javascript">
-function toggle_nav_control() {
-    var elem = $("#toggle_nav_control");
-
-    if (elem.hasClass("off")) {
-        elem.text("Hide Navigation Controls");
-    }
-    else {
-        elem.text("Show Navigation Controls");
-    }
-    $(".page-nav-bar, .bread").toggleClass("vis");
-    elem.toggleClass("off");
-    elem.toggleClass("on");
-}
-</script>
-
-<p>
-<a id="toggle_nav_control" 
-href="javascript:toggle_nav_control()" 
-class="toggle_nav_control off">Show Navigation Controls</a>
-</p>
-
 <perl_for_newbies_tutorial_page idx="1" />