From df658c96fbce3e98b68de11dc4e5e9f8cbadd021 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 5 Feb 2015 08:14:56 +0000 Subject: [PATCH] document dialog: add embed button --- static/js/documentDialog.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/static/js/documentDialog.js b/static/js/documentDialog.js index 85e3be49..86a34c72 100644 --- a/static/js/documentDialog.js +++ b/static/js/documentDialog.js @@ -109,6 +109,28 @@ pandora.ui.documentDialog = function(options) { } }), + $embedButton = Ox.Button({ + title: 'embed', + tooltip: Ox._('Embed'), + type: 'image' + }) + .css({ + position: 'absolute', + right: '4px', + top: '4px' + }) + .bindEvent({ + click: function(data) { + var id = options.items[options.index].id; + pandora.$ui.embedDocumentDialog = pandora.ui.embedDocumentDialog( + id, + pandora.user.ui.documents[id] + ? pandora.user.ui.documents[id].position + : null + ).open(); + } + }), + $selectButton = Ox.ButtonGroup({ buttons: [ {id: 'previous', title: 'left', tooltip: Ox._('Previous')}, @@ -133,7 +155,7 @@ pandora.ui.documentDialog = function(options) { } }); - $(that.find('.OxBar')[0]).append($selectButton); + $(that.find('.OxBar')[0]).append($embedButton).append($selectButton); // fixme: why is this needed? $(that.find('.OxContent')[0]).css({overflow: 'hidden'});