From f937f0ac2c9156af51ae37d897b1c5a0e74546c4 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Sat, 19 Nov 2016 05:03:50 +0100 Subject: [PATCH] hiding controller id chooser --- app/client/app.less | 6 +++++- app/client/startup.js | 8 ++++++++ app/client/tabs.html | 2 +- app/client/tabs.js | 5 +++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/client/app.less b/app/client/app.less index eac6aae..33c7b39 100644 --- a/app/client/app.less +++ b/app/client/app.less @@ -6,6 +6,10 @@ padding-top: 10px; } +.hidden { + display: none; +} + .huge_text { font-size: 3em; } @@ -41,5 +45,5 @@ } .clickable { - cursor:pointer; + cursor:pointer; } diff --git a/app/client/startup.js b/app/client/startup.js index fabfe9b..4823cbd 100644 --- a/app/client/startup.js +++ b/app/client/startup.js @@ -9,6 +9,14 @@ Tracker.autorun(function() { function safeRoute(route) { return function () { + var controllerId = this.params.query.controller_id; + + if(controllerId) { + Session.setPersistent('controller_id', controllerId); + Session.setPersistent('hide_controller_selection', true); + } else { + Session.setPersistent('hide_controller_selection', false); + } console.log('go ', route); if (Meteor.zoblak.client.accessible(route)) { Session.set('templateName', route); diff --git a/app/client/tabs.html b/app/client/tabs.html index 002f10b..329b939 100644 --- a/app/client/tabs.html +++ b/app/client/tabs.html @@ -21,7 +21,7 @@ {{/if}} - diff --git a/app/client/tabs.js b/app/client/tabs.js index 381513c..8924230 100644 --- a/app/client/tabs.js +++ b/app/client/tabs.js @@ -11,6 +11,11 @@ Template.tabs.helpers({ } }, + class_for_changer: function() { + var hide = Session.get('hide_controller_selection'); + return (hide) ? "controller_selection hidden" : "controller_selection"; + }, + selected_controller: function() { return Session.get('controller_id'); },