From 2dae77989c46c77889bbf7e6fd1799535a89b281 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 16 Jan 2014 02:29:04 +0000 Subject: [PATCH] documents panel: properly compute margin on resize --- static/js/documentsPanel.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/static/js/documentsPanel.js b/static/js/documentsPanel.js index 241d75ae4..aedc9b553 100644 --- a/static/js/documentsPanel.js +++ b/static/js/documentsPanel.js @@ -710,14 +710,16 @@ pandora.ui.documentsPanel = function(options) { } function resizeItem() { - var inputWidth = ui.documentSize - 16 - Ox.UI.SCROLLBAR_SIZE, - previewSize = getPreviewSize(); + var size = getPreviewSize(), + width = ui.documentSize - 16 - Ox.UI.SCROLLBAR_SIZE; $preview.options({ - height: previewSize.height, - width: previewSize.width + height: size.height, + width: size.width + }).css({ + margin: size.margin }); $form.options('items').forEach(function($item) { - $item.options({width: inputWidth}); + $item.options({width: width}); }); }