when doubleclicking list info icon, delay opening the dialog until list folders have loaded (and the dialog can actually get the list data)

This commit is contained in:
rolux 2011-11-08 09:46:30 +00:00
parent 910b67c1c1
commit c5617e10e3

View file

@ -155,9 +155,7 @@ pandora.ui.listInfo = function() {
$title, $description; $title, $description;
editable && $icon.bindEvent({ editable && $icon.bindEvent({
doubleclick: function() { doubleclick: editIcon
pandora.$ui.listDialog = pandora.ui.listDialog('icon').open();
}
}); });
that.append($('<div>').css({height: '16px'})); that.append($('<div>').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() { function getIconCSS() {
var size = Math.round(pandora.user.ui.sidebarSize / 2); var size = Math.round(pandora.user.ui.sidebarSize / 2);
return { return {