1
0
Fork 0

Phi: Display the Aircraft Help Screen

This commit is contained in:
Torsten Dreyer 2015-02-06 11:36:53 +01:00
parent d4c1c04923
commit 9173fdfab5
3 changed files with 44 additions and 1 deletions

View file

@ -13,11 +13,15 @@ define([
require : 'topics/Aircraft/Checklists'
});
ko.components.register('Aircraft/Help', {
require : 'topics/Aircraft/Help'
});
function ViewModel(params) {
var self = this;
self.topics = [
/*'Select', */'Mass & Balance', 'Checklists', 'Failures', 'Panel'
/*'Select', */'Mass & Balance', 'Checklists', 'Failures', 'Panel', 'Help'
];
self.selectedTopic = ko.observable();

View file

@ -0,0 +1,6 @@
<style>
</style>
<h2 data-bind="text: helpTitle"></h2>
<div data-bind="foreach: helpText">
<span data-bind="text: $data"></span><br />
</div>

View file

@ -0,0 +1,33 @@
define([
'jquery', 'knockout', 'text!./Help.html'
], function(jquery, ko, htmlString) {
function ViewModel(params) {
var self = this;
self.helpTitle = ko.observable("");
self.helpText = ko.observableArray([]);
jquery.get('/json/sim/help', null, function(data) {
var helpText = [];
data.children.forEach(function(prop) {
if (prop.name === 'title') {
self.helpTitle(prop.value);
} else if (prop.name == 'line') {
helpText.push(prop.value);
}
});
self.helpText(helpText);
});
}
// ViewModel.prototype.dispose = function() {
// }
// Return component definition
return {
viewModel : ViewModel,
template : htmlString
};
});