From e834e2ab94a62ad9db0c3632abd1abf20b68c12b Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Mon, 6 Jul 2015 22:27:16 +0200 Subject: [PATCH] infobox hides sidebar --- lib/infobox/main.js | 2 ++ lib/sidebar.js | 8 ++++++++ scss/main.scss | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/lib/infobox/main.js b/lib/infobox/main.js index 5a12a67..c119cca 100644 --- a/lib/infobox/main.js +++ b/lib/infobox/main.js @@ -7,11 +7,13 @@ define(["infobox/link", "infobox/node"], function (Link, Node) { if (el && el.parentNode) { el.parentNode.removeChild(el) el = undefined + sidebar.reveal() } } function create() { destroy() + sidebar.hide() el = document.createElement("div") sidebar.container.insertBefore(el, sidebar.container.firstChild) diff --git a/lib/sidebar.js b/lib/sidebar.js index ad1521d..e917ec7 100644 --- a/lib/sidebar.js +++ b/lib/sidebar.js @@ -30,6 +30,14 @@ define([], function () { d.render(container) } + self.hide = function () { + container.classList.add("hidden") + } + + self.reveal = function () { + container.classList.remove("hidden") + } + self.container = sidebar return self diff --git a/scss/main.scss b/scss/main.scss index 697354d..084d80e 100644 --- a/scss/main.scss +++ b/scss/main.scss @@ -126,6 +126,10 @@ table.attributes td { border-radius: 2px; } + .container.hidden { + display: none; + } + p { line-height: 1.67em; }