2015-01-25 12:02:20 +00:00
|
|
|
define([
|
|
|
|
'knockout', 'text!./Aircraft.html',
|
|
|
|
], function(ko, htmlString) {
|
|
|
|
ko.components.register('Aircraft/Select', {
|
|
|
|
require : 'topics/Aircraft/Select'
|
|
|
|
});
|
|
|
|
|
|
|
|
ko.components.register('Aircraft/Mass & Balance', {
|
|
|
|
require : 'topics/Aircraft/MassBalance'
|
|
|
|
});
|
|
|
|
|
|
|
|
ko.components.register('Aircraft/Checklists', {
|
|
|
|
require : 'topics/Aircraft/Checklists'
|
|
|
|
});
|
|
|
|
|
2015-02-06 10:36:53 +00:00
|
|
|
ko.components.register('Aircraft/Help', {
|
|
|
|
require : 'topics/Aircraft/Help'
|
|
|
|
});
|
|
|
|
|
2015-01-25 12:02:20 +00:00
|
|
|
function ViewModel(params) {
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
self.topics = [
|
2015-02-22 20:18:23 +00:00
|
|
|
'Mass & Balance', 'Checklists', 'Failures', 'Panel', 'Select', 'Help'
|
2015-01-25 12:02:20 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
self.selectedTopic = ko.observable();
|
|
|
|
|
|
|
|
self.selectedComponent = ko.pureComputed(function(){
|
|
|
|
return "Aircraft/" + self.selectedTopic();
|
|
|
|
});
|
|
|
|
|
|
|
|
self.selectTopic = function(topic) {
|
|
|
|
self.selectedTopic(topic);
|
|
|
|
}
|
|
|
|
|
2015-02-22 20:18:23 +00:00
|
|
|
self.selectTopic(self.topics[self.topics.length-1]);
|
2015-01-25 12:02:20 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ViewModel.prototype.dispose = function() {
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return component definition
|
|
|
|
return {
|
|
|
|
viewModel : ViewModel,
|
|
|
|
template : htmlString
|
|
|
|
};
|
|
|
|
});
|