});\r
};\r
\r
+XOSAdminApp.startNavigation = function() {\r
+ Backbone.history.start();\r
+ XOSAdminApp.navigationStarted = true;\r
+}\r
+\r
+XOSAdminApp.collectionLoadChange = function() {\r
+ stats = xos.getCollectionStatus();\r
+\r
+ if (!XOSAdminApp.navigationStarted) {\r
+ if (stats["isLoaded"] + stats["failedLoad"] >= stats["startedLoad"]) {\r
+ XOSAdminApp.startNavigation();\r
+ } else {\r
+ $("#detail").html("<h3>Loading...</h3><div id='xos-startup-progress'></div>");\r
+ $("#xos-startup-progress").progressbar({value: stats["completedLoad"], max: stats["startedLoad"]});\r
+ }\r
+ }\r
+};\r
+\r
XOSAdminApp.on("start", function() {\r
XOSAdminApp.buildViews();
XOSAdminApp.rewriteLinks();
- if (Backbone.history) {
- console.log("history start");
- Backbone.history.start();
- }
+ // fire it once to initially show the progress bar
+ XOSAdminApp.collectionLoadChange();
+
+ // fire it each time the collection load status is updated
+ Backbone.on("xoslib:collectionLoadChange", XOSAdminApp.collectionLoadChange);
});
$(document).ready(function(){