This commit is contained in:
Senad Uka
2016-11-19 08:34:48 +01:00
parent d17fd8f940
commit d5d4ba872d
4 changed files with 36 additions and 8 deletions

View File

@@ -17,30 +17,37 @@ Template.tabs.helpers({
},
selected_controller: function() {
return Session.get('controller_id');
return
},
accessible: Meteor.zoblak.client.accessible
});
function saveParamsAndGo(where) {
var hideControllerSelection = Session.get('hide_controller_selection');
if (hideControllerSelection) {
Router.go(where + "?controller_id=" + Session.get('controller_id'));
} else {
Router.go(where);
}
}
Template.tabs.events({
'click .start': function() {
Router.go('/');
saveParamsAndGo('/');
},
'click .weather': function() {
Router.go('/weather');
saveParamsAndGo('/weather');
},
'click .log': function() {
Router.go('/log');
saveParamsAndGo('/log');
},
'click .surveillance': function() {
Router.go('/surveillance');
saveParamsAndGo('/surveillance');
},
'click .alarm': function() {
Router.go('/alarm');
saveParamsAndGo('/alarm');
},
'click .settings': function() {
Session.set('templateName', 'settings');