forked from 0x2620/pandora
documents panel: proper live resize for item
This commit is contained in:
parent
9bbefac9f8
commit
a2d5f74a91
1 changed files with 13 additions and 3 deletions
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue