forked from 0x2620/pandora
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:
parent
910b67c1c1
commit
c5617e10e3
1 changed files with 11 additions and 3 deletions
|
@ -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($('<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() {
|
||||
var size = Math.round(pandora.user.ui.sidebarSize / 2);
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue