From 17ecf6da535b855d84a3d6e1c50cb662290e3b3c Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 21 Nov 2014 16:04:54 +0000 Subject: [PATCH] documents panel: testing --- static/js/documentsPanel.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/static/js/documentsPanel.js b/static/js/documentsPanel.js index 97c5228d5..276743c73 100644 --- a/static/js/documentsPanel.js +++ b/static/js/documentsPanel.js @@ -750,7 +750,17 @@ pandora.ui.documentsPanel = function(options) { load: function() { listLoaded = true; !ui.showBrowser && $list.gainFocus(); - setTimeout(selectDocuments); + select(); + function select() { + if ( + $list.options('selected').length == 0 + || $list.value($list.options('selected')[0]) + ) { + selectDocuments(); + } else { + setTimeout(select, 100); + } + } } }); }