From 35087a74a97d82f3cd636a3d4dbe93b07ffb3d26 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 20 Nov 2014 12:24:28 +0000 Subject: [PATCH] entity.js: get rid of type option --- static/js/entity.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/static/js/entity.js b/static/js/entity.js index 285120e94..3813e0faa 100644 --- a/static/js/entity.js +++ b/static/js/entity.js @@ -3,13 +3,13 @@ 'use strict'; pandora.ui.entity = function(options, callback) { - // options: {id, type, view} - Ox.get( - '/static/html/entities.' + options.type + '.' + options.view + '.html', - function(html) { - pandora.api.getEntity({ - id: options.id - }, function(data) { + // options: {id, view} + pandora.api.getEntity({ + id: options.id + }, function(data) { + Ox.get( + '/static/html/entities.' + data.type + '.' + options.view + '.html', + function(html) { html = html.replace(/\{(.+?)\}/g, function() { var parts = arguments[1].split('|'), value = data[parts[0]]; @@ -21,7 +21,7 @@ pandora.ui.entity = function(options, callback) { : value; }); callback(html); - }); - } - ); + } + ); + }); }; \ No newline at end of file