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( pandora.api.getEntity({
'/static/html/entities.' + options.type + '.' + options.view + '.html', id: options.id
function(html) { }, function(data) {
pandora.api.getEntity({ Ox.get(
id: options.id '/static/html/entities.' + data.type + '.' + options.view + '.html',
}, function(data) { 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);
}); }
} );
); });
}; };