created and tested server side water control
This commit is contained in:
39
app/client/tabs.js
Normal file
39
app/client/tabs.js
Normal file
@@ -0,0 +1,39 @@
|
||||
if (Meteor.isClient) {
|
||||
|
||||
Template.tabs.helpers({
|
||||
class_for: function(tab_name) {
|
||||
var templateName = Session.get('templateName');
|
||||
|
||||
if (templateName === tab_name) {
|
||||
return tab_name + ' active';
|
||||
} else if (templateName === 'display' && tab_name === 'news') {
|
||||
return tab_name + ' active'
|
||||
} else {
|
||||
return tab_name;
|
||||
}
|
||||
},
|
||||
|
||||
selected_controller: function() {
|
||||
return Session.get('controller_id');
|
||||
},
|
||||
});
|
||||
|
||||
Template.tabs.events({
|
||||
'click .start': function() {
|
||||
Session.set('templateName', 'start');
|
||||
},
|
||||
'click .weather': function() {
|
||||
Session.set('templateName', 'weather');
|
||||
},
|
||||
'click .log': function() {
|
||||
Session.set('templateName', 'log');
|
||||
},
|
||||
|
||||
'click #switch': function() {
|
||||
var instance = Template.instance();
|
||||
controller_id = instance.$('#controller').val();
|
||||
Session.setPersistent('controller_id', controller_id);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user