Permalink
Browse files

Navigation menu should show links to Github/Google when contracted.

  • Loading branch information...
1 parent 11e5391 commit 802f0998e87f4e470ba78eef3d194c387587d2da @assaf committed Dec 24, 2012
Showing with 12 additions and 5 deletions.
  1. +7 −1 doc/new/zombie.css
  2. +5 −4 doc/new/zombie.js
View
@@ -155,13 +155,19 @@ strong {
content: "\02261\0A0 More";
}
#navigation-bar.expanded a.expand span:before {
- content: "\02261\0A0 Fold";
+ content: "\02261\0A0 Close";
}
#navigation-bar ul {
list-style: none;
padding: 0 0 0.6em 1.2em;
margin: 0;
}
+#navigation-bar.contracted li {
+ display: none;
+}
+#navigation-bar.contracted li.always-shown {
+ display: inline-block;
+}
#navigation-bar li {
display: inline-block;
padding: 0;
View
@@ -22,19 +22,19 @@ function pageReady() {
return cssRule.style;
}
}
- cssRule = document.styleSheets[0].addRule(selector, "color: red");
- console.log(cssRule);
return cssRule.style;
}
// Adds a navigation link to the navigation bar. Obviously at the very end.
- function addLinkToNavigationLinks(linkText, linkURL) {
+ function addLinkToNavigationLinks(linkText, linkURL, alwaysShown) {
var a = document.createElement("a");
a.textContent = linkText;
a.href = linkURL;
var li = document.createElement("li");
li.appendChild(a);
+ if (alwaysShown)
+ li.setAttribute("class", "always-shown");
navigationLinks.appendChild(li);
}
@@ -56,7 +56,7 @@ function pageReady() {
// Add static links to navigation links
staticLinks.forEach(function(staticLink) {
- addLinkToNavigationLinks(staticLink[0], staticLink[1]);
+ addLinkToNavigationLinks(staticLink[0], staticLink[1], true);
});
// Determine fix width for these links
@@ -95,6 +95,7 @@ function pageReady() {
navigationBar.className = "contracted";
event.stopPropagation();
event.preventDefault();
+ setNavigationBarHeight();
});
// Clicking anywhere else on the page, including navigation link, closes the
// navigation bar.

0 comments on commit 802f099

Please sign in to comment.