1
0
Fork 0
fgdata/Phi/topics/Environment/Weather/Boundary.js
Torsten Dreyer 190e8449ce Phi: move URL to the browsers root directory
- rename the directory from webgui to Phi
- let the webserver's root point to Phi instead of Docs
- redirect old /gui/ url to the new location (/)
2015-04-18 13:03:46 +02:00

36 lines
1 KiB
JavaScript

define([
'jquery', 'knockout', 'text!./Boundary.html', './LayerData', 'kojqui/selectmenu'
], function(jquery, ko, htmlString, layerData ) {
function ViewModel(params) {
var self = this;
self.layerData = ko.observableArray([]);
jquery.get('/json/environment/config/boundary?d=2', null, function(data) {
var assemble = function(data) {
var l = [];
data.children.forEach(function(prop) {
if (prop.name === 'entry') {
var layer = new layerData();
l.push(ko.utils.knockprops.propsToObject(prop, layer.PropertyMap, layer ));
}
});
return l.reverse();
}
self.layerData(assemble(data));
});
}
// ViewModel.prototype.dispose = function() {
// }
// Return component definition
return {
viewModel : ViewModel,
template : htmlString
};
});