1
0
mirror of https://github.com/fazo96/markcloud.git synced 2025-01-25 13:24:20 +01:00

added spinner

This commit is contained in:
fazo96 2014-10-04 10:34:13 +02:00
parent 0189dec725
commit cac43cb4c0
5 changed files with 25 additions and 3 deletions

View File

@ -10,4 +10,5 @@ coffeescript
less less
perak:markdown perak:markdown
natestrauser:font-awesome natestrauser:font-awesome
mrt:moment

View File

@ -36,6 +36,7 @@ minimongo@1.0.3
mizzao:bootstrap-3@3.2.0_1 mizzao:bootstrap-3@3.2.0_1
mobile-status-bar@1.0.0 mobile-status-bar@1.0.0
mongo@1.0.6 mongo@1.0.6
mrt:moment@2.8.1
natestrauser:font-awesome@4.2.0 natestrauser:font-awesome@4.2.0
observe-sequence@1.0.2 observe-sequence@1.0.2
ordered-dict@1.0.0 ordered-dict@1.0.0

View File

@ -7,6 +7,10 @@ Router.map ->
@route 'home', @route 'home',
path: '/' path: '/'
waitOn: -> Meteor.subscribe 'docs' waitOn: -> Meteor.subscribe 'docs'
action: ->
if !@ready()
@render(); @render 'spinner', to: 'outside'
else @render()
@route 'doc', @route 'doc',
path: '/d/:_id' path: '/d/:_id'
layoutTemplate: 'docLayout' layoutTemplate: 'docLayout'
@ -18,6 +22,8 @@ Router.map ->
else @render 'loading' else @render 'loading'
@route 'new' @route 'new'
Template.layout.showSpinner = ->
Meteor.status().connected is no or Router.current().ready() is no
Template.home.ndocs = -> docs.find().count() Template.home.ndocs = -> docs.find().count()
Template.new.events Template.new.events
'click #new-btn': (e,t) -> 'click #new-btn': (e,t) ->

View File

@ -2,6 +2,12 @@
max-width: 40em; max-width: 40em;
} }
#spinner {
position: fixed;
right: 1em;
top: 1em;
}
#new-btn { #new-btn {
margin-top: 1em; margin-top: 1em;
} }

View File

@ -1,4 +1,5 @@
<template name="layout"> <template name="layout">
{{> yield region="outside"}}
<div class="container"> <div class="container">
<h1>MarkCloud</h1> <h1>MarkCloud</h1>
<hr> <hr>
@ -21,6 +22,7 @@
</template> </template>
<template name="docLayout"> <template name="docLayout">
{{> yield region="outside"}}
<div class="container">{{> yield}}</div> <div class="container">{{> yield}}</div>
</template> </template>
@ -31,7 +33,13 @@
</template> </template>
<template name="loading"> <template name="loading">
<div class="text-center"> <div class="text-center">
<i class="fa fa-cog fa-spin fa-3x"></i> <i class="fa fa-cog fa-spin fa-3x"></i>
</div> </div>
</template>
<template name="spinner">
<div id="spinner">
<i class="fa fa-2x fa-cog fa-spin"></i>
</div>
</template> </template>