From a4b022368e72de5a17db35863e94f27aec5677a1 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 17 Dec 2014 15:23:49 +0000 Subject: [PATCH] update entity dialog --- static/js/entityDialog.js | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/static/js/entityDialog.js b/static/js/entityDialog.js index c787a1570..3c17043a3 100644 --- a/static/js/entityDialog.js +++ b/static/js/entityDialog.js @@ -10,11 +10,34 @@ pandora.ui.entityDialog = function() { .css({overflowY: 'auto'}), that = Ox.Dialog({ + buttons: (ui.canManageEntities ? [ + Ox.Button({ + id: 'edit', + title: Ox._('Edit Entity...') + }) + .bindEvent({ + click: function() { + that.close(); + pandora.$ui.entitiesDialog = pandora.ui.entitiesDialog().open(); + } + }), + {} + ] : []).concat([ + Ox.Button({ + id: 'close', + title: Ox._('Close') + }) + .bindEvent({ + click: function() { + that.close(); + } + }) + ]), closeButton: true, content: $content, fixedSize: true, - focus: false, height: 416, + keyboard: {escape: 'close'}, padding: 0, removeOnClose: true, title: '', @@ -51,7 +74,7 @@ pandora.ui.entityDialog = function() { } function setTitle() { - ui.entity && pandora.api.getEntity({ + ui.part.entities && pandora.api.getEntity({ id: ui.part.entities }, function(result) { that.options({title: result.data.name});