forked from 0x2620/pandora
entity.js: get rid of type option
This commit is contained in:
parent
61a281ec32
commit
35087a74a9
1 changed files with 10 additions and 10 deletions
|
@ -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);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
});
|
||||||
};
|
};
|
Loading…
Reference in a new issue