summaryrefslogtreecommitdiff
path: root/js/controller
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-10-15 22:36:58 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-10-15 22:36:58 -0400
commit43dc1e9dcc762be0f0e24c80f862f8425b093133 (patch)
tree4fe2171b55d607c3b33016440cb11dd03b26682a /js/controller
parentc45bbaf0c3aaf91150088d5153bfaa86c092fdf7 (diff)
js: Add loading spinner to packages page.
* css/guix.css: Add spinner styles. * js/controller/packages.js (guix.packages.view): Explicitly redraw after loading packages. * js/model/packages.js (guix.packages.Packages): Load packages in the background. * js/view/layout.js (guix.withLayout): Cast elem to array if needed. * js/view/packages.js (guix.packages.view): Render spinner when there are no packages to display.
Diffstat (limited to 'js/controller')
-rw-r--r--js/controller/packages.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/js/controller/packages.js b/js/controller/packages.js
index 3a7858d..db94d72 100644
--- a/js/controller/packages.js
+++ b/js/controller/packages.js
@@ -20,7 +20,6 @@
function controller() {
var self = this;
- this.packages = packages.Packages();
this.pages = m.prop([]);
this.currentPageIndex = 0;
this.pageSize = 20;
@@ -47,10 +46,12 @@
this.phase = m.prop(packages.PHASE_NONE);
this.selectedPackage = m.prop(null);
- // All packages are visible initially
- this.packages.then(function(packages) {
- self.pages(self.paginate(packages, self.pageSize));
- });
+ this.packages = packages.Packages()
+ .then(function(packages) {
+ // All packages are visible initially
+ self.pages(self.paginate(packages, self.pageSize));
+ })
+ .then(m.redraw);
};