From 1a6ea4f58a1ac1a503806563198152db0e041e78 Mon Sep 17 00:00:00 2001 From: rr- Date: Sun, 29 May 2016 12:27:02 +0200 Subject: [PATCH] client/top-nav: hide top nav for home --- client/js/views/top_nav_view.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/client/js/views/top_nav_view.js b/client/js/views/top_nav_view.js index 30a6c97..ac8c17b 100644 --- a/client/js/views/top_nav_view.js +++ b/client/js/views/top_nav_view.js @@ -6,17 +6,32 @@ class TopNavView { constructor() { this._template = views.getTemplate('top-nav'); this._navHolder = document.getElementById('top-nav-holder'); + this._lastCtx = null; } render(ctx) { + this._lastCtx = ctx; const target = this._navHolder; const source = this._template(ctx); - - views.showView(this._navHolder, source); } + show() { + this._navHolder.style.visibility = 'initial'; + this._navHolder.style.position = 'initial'; + } + + hide() { + this._navHolder.style.visibility = 'hidden'; + this._navHolder.style.position = 'fixed'; + } + activate(itemName) { + if (itemName == 'home') { + this.hide(); + } else { + this.show(); + } const allItemsSelector = '#top-nav-holder [data-name]'; const currentItemSelector = '#top-nav-holder [data-name="' + itemName + '"]';