From 51cc28258c064001f758b10902a460bbd21e8aa5 Mon Sep 17 00:00:00 2001 From: tekkub Date: Mon, 27 Jul 2009 18:23:09 -0600 Subject: Add expand/collapse icons, tweak sidebar style --- _layouts/default.html | 23 ++++++++++++++--------- css/style.css | 18 +++++++++++++++++- images/collapse.png | Bin 0 -> 178 bytes images/expand.png | Bin 0 -> 177 bytes js/main.js | 10 +++++----- 5 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 images/collapse.png create mode 100644 images/expand.png diff --git a/_layouts/default.html b/_layouts/default.html index 71ba56d..84550d5 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -47,22 +47,27 @@ sidebar_cats:
-
+

{{ page.title }}

- {{ content }} +
+ {{ content }} +
diff --git a/css/style.css b/css/style.css index 1e93a47..4dcaa9a 100755 --- a/css/style.css +++ b/css/style.css @@ -5,14 +5,30 @@ .category_index dt { margin-left: 0.5em !important; } .category_index dd { margin-left: 1.5em !important; } +#guides .guide .sidebar h3 { + color: black; + cursor: pointer; +} +#guides .guide .sidebar ul { margin-left: 0; } +#guides .guide .sidebar ul li { + padding-left: 14px; + background: white url(/images/expand.png) -2px 2px no-repeat; + margin: .2em 0; +} +#guides .guide .sidebar ul li.expanded { background: white url(/images/collapse.png) -2px 2px no-repeat; } + .sidebar dl { display: none; - margin-bottom: 0; + margin-bottom: 1em; } +.sidebar dt { font-weight: bold; } +.sidebar dd { margin-bottom: 0.5em; } + pre.terminal { padding: 1em !important; background: #444 !important; color: white !important; font-size: 0.9em !important; } + diff --git a/images/collapse.png b/images/collapse.png new file mode 100644 index 0000000..0c7f37b Binary files /dev/null and b/images/collapse.png differ diff --git a/images/expand.png b/images/expand.png new file mode 100644 index 0000000..19862cf Binary files /dev/null and b/images/expand.png differ diff --git a/js/main.js b/js/main.js index f4772ea..d400b79 100644 --- a/js/main.js +++ b/js/main.js @@ -1,14 +1,14 @@ $(function(){ if (typeof main_category == "undefined") { - $(".sidebar dl:first").slideDown(2) + $(".sidebar dl:first").slideDown("slow").parent().addClass("expanded") } else { - $(".sidebar dl#" + main_category).slideDown(2) + $(".sidebar dl#" + main_category).slideDown("slow").parent().addClass("expanded") } $(".sidebar h3").click(function(){ - if ($(".sidebar dl#" + this.id).is(":hidden")) { - $(".sidebar dl:visible").slideUp("fast") - $(".sidebar dl#" + this.id).show("fast") + if ($(this).siblings("dl").is(":hidden")) { + $(".sidebar dl:visible").slideUp("fast").parent().removeClass("expanded") + $(this).siblings("dl").slideDown("fast").parent().addClass("expanded") } }) }) \ No newline at end of file -- cgit v1.3.1