diff --git a/static/js/pandora/info.js b/static/js/pandora/info.js index a18c1a03..5611fc35 100644 --- a/static/js/pandora/info.js +++ b/static/js/pandora/info.js @@ -155,9 +155,7 @@ pandora.ui.listInfo = function() { $title, $description; editable && $icon.bindEvent({ - doubleclick: function() { - pandora.$ui.listDialog = pandora.ui.listDialog('icon').open(); - } + doubleclick: editIcon }); that.append($('
').css({height: '16px'})); @@ -264,6 +262,16 @@ pandora.ui.listInfo = function() { ); } + function editIcon() { + // timeout is needed since if the icon is clicked before the list + // folders have loaded, the list dialog cannot get the list data yet. + if (pandora.getListData().id) { + pandora.$ui.listDialog = pandora.ui.listDialog('icon').open(); + } else { + setTimeout(editIcon, 250); + } + } + function getIconCSS() { var size = Math.round(pandora.user.ui.sidebarSize / 2); return {