1
0
Fork 0
fgdata/webgui/topics/Simulator.js
2015-03-04 09:40:25 +01:00

53 lines
1.2 KiB
JavaScript

define([
'knockout', 'text!./Simulator.html'
], function(ko, htmlString) {
ko.components.register('Simulator/Screenshot', {
require : 'topics/Simulator/Screenshot'
});
ko.components.register('Simulator/Properties', {
require : 'topics/Simulator/Properties'
});
ko.components.register('Simulator/Config', {
require : 'topics/Simulator/Config'
});
ko.components.register('Simulator/Reset', {
require : 'topics/Simulator/Reset'
});
ko.components.register('Simulator/Exit', {
require : 'topics/Simulator/Exit'
});
function ViewModel(params) {
var self = this;
self.topics = [
'Screenshot', 'Properties', 'Config', 'Reset', 'Exit'
];
self.selectedTopic = ko.observable();
self.selectedComponent = ko.pureComputed(function() {
return "Simulator/" + self.selectedTopic();
});
self.selectTopic = function(topic) {
self.selectedTopic(topic);
}
self.selectTopic(self.topics[0]);
}
ViewModel.prototype.dispose = function() {
}
// Return component definition
return {
viewModel : ViewModel,
template : htmlString
};
});