2015-01-25 12:02:20 +00:00
|
|
|
define([
|
|
|
|
'knockout', 'text!./Tools.html'
|
|
|
|
], function(ko, htmlString) {
|
|
|
|
|
2015-02-18 11:31:00 +00:00
|
|
|
ko.components.register('Tools/Stopwatch', {
|
|
|
|
require : 'topics/Tools/Stopwatch'
|
|
|
|
});
|
|
|
|
|
2015-01-25 12:02:20 +00:00
|
|
|
function ViewModel(params) {
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
self.topics = [
|
|
|
|
'Holding Pattern',
|
|
|
|
'Wind Calculator',
|
|
|
|
'Vertical Navigation',
|
|
|
|
'Stopwatch'
|
|
|
|
];
|
|
|
|
|
|
|
|
self.selectedTopic = ko.observable();
|
|
|
|
|
|
|
|
self.selectedComponent = ko.pureComputed(function() {
|
|
|
|
return "Tools/" + 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
|
|
|
|
};
|
|
|
|
});
|