replace item menu once all folders have loaded (and listData is available)
This commit is contained in:
parent
eb0575798e
commit
4ae9b3042a
1 changed files with 9 additions and 3 deletions
|
@ -10,12 +10,13 @@ pandora.ui.folders = function(section) {
|
|||
pandora.resizeFolders();
|
||||
}
|
||||
}),
|
||||
counter = 0,
|
||||
editable = (ui[
|
||||
section == 'items' ? '_list' : section.slice(0, -1)
|
||||
] || '').split(':')[0] == pandora.user.username,
|
||||
folderItems = section == 'items' ? 'Lists' : Ox.toTitleCase(section),
|
||||
folderItem = folderItems.slice(0, -1);
|
||||
folderItem = folderItems.slice(0, -1),
|
||||
initCounter = 0,
|
||||
loadCounter = 0;
|
||||
pandora.$ui.allItems = pandora.ui.allItems(section).appendTo(that);
|
||||
pandora.$ui.folder = [];
|
||||
pandora.$ui.folderBrowser = {};
|
||||
|
@ -343,13 +344,18 @@ pandora.ui.folders = function(section) {
|
|||
})
|
||||
.bindEventOnce({
|
||||
init: function(data) {
|
||||
if (++counter == pandora.site.sectionFolders[section].length) {
|
||||
if (++initCounter == pandora.site.sectionFolders[section].length) {
|
||||
pandora.$ui.folder.forEach(function($folder) {
|
||||
that.append($folder);
|
||||
});
|
||||
pandora.resizeFolders(section);
|
||||
pandora.selectList();
|
||||
}
|
||||
},
|
||||
load: function(data) {
|
||||
if (++loadCounter == pandora.site.sectionFolders[section].length) {
|
||||
pandora.$ui.mainMenu.replaceItemMenu();
|
||||
}
|
||||
}
|
||||
})
|
||||
.appendTo(pandora.$ui.folder[i].$content);
|
||||
|
|
Loading…
Reference in a new issue