Last active
December 14, 2015 02:28
-
-
Save svasva/5013448 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name='loadingWrapper'> | |
{{#if loading}} | |
<i class="icon-refresh icon-spin"></i> | |
Loading... | |
{{else}} | |
<div class="span9"> | |
{{renderPage}} | |
</div> | |
{{> sidebar }} | |
{{/if}} | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Meteor.autorun -> | |
loaded = -> Session.set 'loading', false | |
Session.set 'loading', true | |
switch Meteor.Router.page() | |
when 'bikes' | |
Meteor.subscribe 'bikes-count' | |
Meteor.subscribe 'bikes', {}, Session.get('page'), loaded | |
when 'showBike' | |
Meteor.subscribe 'bike', Session.get('bikeId'), loaded | |
when 'messageDialog' | |
Meteor.subscribe 'messages', Session.get('userId'), loaded | |
when 'userProfile' | |
Meteor.subscribe 'user', Session.get('userId'), loaded | |
when 'partsCatalog' | |
Meteor.subscribe 'parts_catalog', loaded | |
else loaded() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment