diff --git a/static/js/documentsPanel.js b/static/js/documentsPanel.js index af294226..97c5228d 100644 --- a/static/js/documentsPanel.js +++ b/static/js/documentsPanel.js @@ -383,7 +383,13 @@ pandora.ui.documentsPanel = function(options) { pandora_showdocument: function(data) { isItemView && that.toggleElement(1); } - }); + }) + .bindEvent( + 'pandora_documentsselection.' + ( + isItemView ? ui.item.toLowerCase() : '' + ), + selectDocuments + ); if (isItemView) { pandora.$ui.documentsList = $list; @@ -395,11 +401,6 @@ pandora.ui.documentsPanel = function(options) { $findInput.options({width: getFindInputWidth()}); }); - that.bindEvent( - 'pandora_documentsselection.' + (isItemView ? ui.item.toLowerCase() : ''), - selectDocuments - ); - function addDocuments() { var ids = ui.documentsSelection['']; pandora.api.addDocument({ @@ -748,8 +749,8 @@ pandora.ui.documentsPanel = function(options) { .bindEventOnce({ load: function() { listLoaded = true; - selectDocuments(); !ui.showBrowser && $list.gainFocus(); + setTimeout(selectDocuments); } }); }