diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 475b192e1..bb451c7fc 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -1152,10 +1152,10 @@ define([ var FILTER_BY = "filterBy"; - var refresh = APP.refresh = function () { + var refresh = APP.refresh = function (cb) { var type = APP.store[FILTER_BY]; var path = type ? [FILTER, type, currentPath] : currentPath; - APP.displayDirectory(path); + APP.displayDirectory(path, undefined, cb); }; // `app`: true (force open wiht the app), false (force open in preview), @@ -4289,10 +4289,12 @@ define([ appStatus.ready(true); }; - var displayDirectory = APP.displayDirectory = function (path, force) { + var displayDirectory = APP.displayDirectory = function (path, force, cb) { + cb = cb || function () {}; if (APP.closed || (APP.$content && !$.contains(document.documentElement, APP.$content[0]))) { return; } if (history.isHistoryMode) { - return void _displayDirectory(path, force); + _displayDirectory(path, force); + return void cb(); } if (!manager.comparePath(currentPath, path)) { removeSelected(); @@ -4301,6 +4303,7 @@ define([ copyObjectValue(files, proxy.drive); updateSharedFolders(sframeChan, manager, files, folders, function () { _displayDirectory(path, force); + cb(); }); }); }; @@ -5346,8 +5349,9 @@ define([ }; APP.FM = common.createFileManager(fmConfig); - refresh(); - UI.removeLoadingScreen(); + refresh(function () { + UI.removeLoadingScreen(); + }); /* if (!APP.team) {