From cac43cb4c08664c3cfcc841b5317c9ed3fe682d0 Mon Sep 17 00:00:00 2001 From: fazo96 Date: Sat, 4 Oct 2014 10:34:13 +0200 Subject: [PATCH] added spinner --- .meteor/packages | 1 + .meteor/versions | 1 + client/client.coffee | 6 ++++++ client/style.less | 6 ++++++ client/templates.html | 14 +++++++++++--- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.meteor/packages b/.meteor/packages index a225f84..3dadb4f 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -10,4 +10,5 @@ coffeescript less perak:markdown natestrauser:font-awesome +mrt:moment diff --git a/.meteor/versions b/.meteor/versions index 906ce07..687ca0f 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -36,6 +36,7 @@ minimongo@1.0.3 mizzao:bootstrap-3@3.2.0_1 mobile-status-bar@1.0.0 mongo@1.0.6 +mrt:moment@2.8.1 natestrauser:font-awesome@4.2.0 observe-sequence@1.0.2 ordered-dict@1.0.0 diff --git a/client/client.coffee b/client/client.coffee index 89902aa..bcf227a 100644 --- a/client/client.coffee +++ b/client/client.coffee @@ -7,6 +7,10 @@ Router.map -> @route 'home', path: '/' waitOn: -> Meteor.subscribe 'docs' + action: -> + if !@ready() + @render(); @render 'spinner', to: 'outside' + else @render() @route 'doc', path: '/d/:_id' layoutTemplate: 'docLayout' @@ -18,6 +22,8 @@ Router.map -> else @render 'loading' @route 'new' +Template.layout.showSpinner = -> + Meteor.status().connected is no or Router.current().ready() is no Template.home.ndocs = -> docs.find().count() Template.new.events 'click #new-btn': (e,t) -> diff --git a/client/style.less b/client/style.less index 4eb7cac..4b8125d 100644 --- a/client/style.less +++ b/client/style.less @@ -2,6 +2,12 @@ max-width: 40em; } +#spinner { + position: fixed; + right: 1em; + top: 1em; +} + #new-btn { margin-top: 1em; } diff --git a/client/templates.html b/client/templates.html index db33416..43150e4 100644 --- a/client/templates.html +++ b/client/templates.html @@ -1,4 +1,5 @@ @@ -31,7 +33,13 @@ + +