hiding controller id chooser
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.huge_text {
|
||||
font-size: 3em;
|
||||
}
|
||||
@@ -41,5 +45,5 @@
|
||||
}
|
||||
|
||||
.clickable {
|
||||
cursor:pointer;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<li role="presentation" class="{{ class_for 'alarm' }}"><a class="clickable">Alarm</a></li>
|
||||
{{/if}}
|
||||
|
||||
<li role="presentation" class="controller_selection"> <input type="number" id="controller" name="controller" value="{{ selected_controller }}" min="1" max="99999"> <button id="switch" name="switch">Prebaci</button>
|
||||
<li role="presentation" class="{{ class_for_changer }}"> <input type="number" id="controller" name="controller" value="{{ selected_controller }}" min="1" max="99999"> <button id="switch" name="switch">Prebaci</button>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
@@ -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');
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user