Vulcan/packages/telescope-core/lib/router/config.js

34 lines
996 B
JavaScript
Raw Normal View History

2014-11-19 10:17:05 +09:00
Router.setTemplateNameConverter(function (str) { return str; });
Telescope.subscriptions.preload('settings');
Telescope.subscriptions.preload('currentUser');
Router.configure({
2015-04-13 16:29:33 +09:00
layoutTemplate: 'layout',
loadingTemplate: 'loading',
notFoundTemplate: 'notFound',
waitOn: function () {
return _.map(Telescope.subscriptions, function(sub){
// can either pass strings or objects with subName and subArguments properties
if (typeof sub === 'object'){
Meteor.subscribe(sub.subName, sub.subArguments);
}else{
Meteor.subscribe(sub);
}
});
}
});
// adding common subscriptions that's need to be loaded on all the routes
// notification does not included here since it is not much critical and
// it might have considerable amount of docs
if(Meteor.isServer) {
FastRender.onAllRoutes(function() {
var router = this;
_.each(Telescope.subscriptions, function(sub){
router.subscribe(sub);
});
});
}
2015-04-22 08:47:23 +09:00
Telescope.controllers = {};