1
0
Fork 0
fgdata/webgui/topics/Aircraft/Help.js
2015-02-06 11:36:53 +01:00

33 lines
850 B
JavaScript

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
};
});