Phi: Display the Aircraft Help Screen
This commit is contained in:
parent
d4c1c04923
commit
9173fdfab5
3 changed files with 44 additions and 1 deletions
|
@ -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();
|
||||
|
|
6
webgui/topics/Aircraft/Help.html
Normal file
6
webgui/topics/Aircraft/Help.html
Normal 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>
|
33
webgui/topics/Aircraft/Help.js
Normal file
33
webgui/topics/Aircraft/Help.js
Normal 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
|
||||
};
|
||||
});
|
Loading…
Reference in a new issue