Vulcan/packages/nova-core/lib/router.jsx

48 lines
1.4 KiB
React
Raw Normal View History

2016-02-17 17:22:32 +09:00
FlowRouter.extendPathWithQueryParams = (path, params, newQueryParams) => {
const current = FlowRouter.current();
const currentQueryParams = _.clone(current.queryParams);
return FlowRouter.path(path, params, _.extend(currentQueryParams, newQueryParams));
};
2016-02-17 14:39:56 +09:00
// FlowRouter.addToQueryArray = function (key, value) {
// var keyArray = FlowRouter.getQueryParam(key) || [];
// keyArray.push(value);
// var params = {};
// params[key] = keyArray;
// FlowRouter.setQueryParams(params);
// }
// FlowRouter.removeFromQueryArray = function (key, value) {
// var keyArray = FlowRouter.getQueryParam(key);
// keyArray = _.without(keyArray, value);
// var params = {};
// params[key] = keyArray;
// FlowRouter.setQueryParams(params);
// }
// Telescope.adminRoutes = FlowRouter.group({
// prefix: '/admin',
// name: 'admin'
// });
// FlowRouter.notFound = {
// action: function() {
// if (Meteor.isClient) {
// DocHead.addMeta({
// name: "name",
// property: "prerender-status-code",
// content: "404"
// });
// DocHead.addMeta({
// name: "name",
// property: "robots",
// content: "noindex, nofollow"
// });
// }
// BlazeLayout.render("layout", {main: "not_found"});
// }
// };
// FlowRouter.triggers.enter([function () {Events.analyticsRequest()}]);
// FlowRouter.triggers.exit([function () {Messages.clearSeen()}]);