entity.js: get rid of type option

This commit is contained in:
rolux 2014-11-20 12:24:28 +00:00
parent 61a281ec32
commit 35087a74a9

View file

@ -3,13 +3,13 @@
'use strict'; 'use strict';
pandora.ui.entity = function(options, callback) { pandora.ui.entity = function(options, callback) {
// options: {id, type, view} // options: {id, view}
Ox.get(
'/static/html/entities.' + options.type + '.' + options.view + '.html',
function(html) {
pandora.api.getEntity({ pandora.api.getEntity({
id: options.id id: options.id
}, function(data) { }, function(data) {
Ox.get(
'/static/html/entities.' + data.type + '.' + options.view + '.html',
function(html) {
html = html.replace(/\{(.+?)\}/g, function() { html = html.replace(/\{(.+?)\}/g, function() {
var parts = arguments[1].split('|'), var parts = arguments[1].split('|'),
value = data[parts[0]]; value = data[parts[0]];
@ -21,7 +21,7 @@ pandora.ui.entity = function(options, callback) {
: value; : value;
}); });
callback(html); callback(html);
});
} }
); );
});
}; };