From 3aadc0f5136f5006d00f2db510bbc5248198eb10 Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 21 Nov 2014 16:09:42 +0000 Subject: [PATCH] documents panel: testing --- static/js/documentsPanel.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/static/js/documentsPanel.js b/static/js/documentsPanel.js index 276743c7..c6107cf0 100644 --- a/static/js/documentsPanel.js +++ b/static/js/documentsPanel.js @@ -750,15 +750,16 @@ pandora.ui.documentsPanel = function(options) { load: function() { listLoaded = true; !ui.showBrowser && $list.gainFocus(); - select(); - function select() { - if ( - $list.options('selected').length == 0 - || $list.value($list.options('selected')[0]) - ) { + if ($list.options('selected').length == 0) { + selectDocuments() + } else { + selectDocumentsLater(); + } + function selectDocumentsLater() { + if ($list.value($list.options('selected')[0])) { selectDocuments(); } else { - setTimeout(select, 100); + setTimeout(selectDocumentsLater, 100); } } }