diff --git a/static/js/documentsPanel.js b/static/js/documentsPanel.js index a03c0586..241d75ae 100644 --- a/static/js/documentsPanel.js +++ b/static/js/documentsPanel.js @@ -351,14 +351,12 @@ pandora.ui.documentsPanel = function(options) { .bindEvent({ resize: function(data) { ui.documentSize = data.size; - //fixme: resize preview panel + resizeItem(); }, resizeend: function(data) { // set to 0 so that UI.set registers a change of the value ui.documentSize = 0; pandora.UI.set({documentSize: data.size}); - //fixme: resize preview panel instead - selectDocuments(); }, toggle: function(data) { pandora.UI.set({showDocument: !data.collapsed}); @@ -711,6 +709,18 @@ pandora.ui.documentsPanel = function(options) { }); } + function resizeItem() { + var inputWidth = ui.documentSize - 16 - Ox.UI.SCROLLBAR_SIZE, + previewSize = getPreviewSize(); + $preview.options({ + height: previewSize.height, + width: previewSize.width + }); + $form.options('items').forEach(function($item) { + $item.options({width: inputWidth}); + }); + } + function selectDocuments() { var selected = ui.documentsSelection[isItemView ? ui.item : ''] || [], string = selected.length < 2 ? 'Document'