From cd5cfc160914330abc04570792988b6224ab2cad Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 27 Aug 2016 13:12:13 -0700 Subject: [PATCH] Show a spinner while the applist loads --- static/js/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/static/js/index.js b/static/js/index.js index 3d81b45..dfc9a5f 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -320,7 +320,14 @@ function showApps() { } $('#quitCurrentApp').show(); $("#game-grid").empty(); + + // Show a spinner while the applist loads + $('#naclSpinnerMessage').text('Loading apps...'); + $('#naclSpinner').css('display', 'inline-block'); + api.getAppList().then(function (appList) { + $('#naclSpinner').hide(); + // if game grid is populated, empty it appList.forEach(function (app) { api.getBoxArt(app.id).then(function (resolvedPromise) { @@ -344,6 +351,8 @@ function showApps() { }); }); }, function (failedAppList) { + $('#naclSpinner').hide(); + console.log('Failed to get applist from host: ' + api.address); console.log('failed API object: '); console.log(api.toString());