|
@@ -1,3 +1,8 @@
|
|
|
|
+let previousPath;
|
|
|
|
+FlowRouter.triggers.exit([({path}) => {
|
|
|
|
+ previousPath = path;
|
|
|
|
+}]);
|
|
|
|
+
|
|
FlowRouter.route('/', {
|
|
FlowRouter.route('/', {
|
|
name: 'home',
|
|
name: 'home',
|
|
triggersEnter: [AccountsTemplates.ensureSignedIn],
|
|
triggersEnter: [AccountsTemplates.ensureSignedIn],
|
|
@@ -5,7 +10,8 @@ FlowRouter.route('/', {
|
|
EscapeActions.executeAll();
|
|
EscapeActions.executeAll();
|
|
Filter.reset();
|
|
Filter.reset();
|
|
|
|
|
|
- Session.set('currentBoard', '');
|
|
|
|
|
|
+ Session.set('currentBoard', null);
|
|
|
|
+ Session.set('currentCard', null);
|
|
|
|
|
|
BlazeLayout.render('defaultLayout', { content: 'boardList' });
|
|
BlazeLayout.render('defaultLayout', { content: 'boardList' });
|
|
}
|
|
}
|
|
@@ -31,14 +37,32 @@ FlowRouter.route('/b/:id/:slug', {
|
|
FlowRouter.route('/b/:boardId/:slug/:cardId', {
|
|
FlowRouter.route('/b/:boardId/:slug/:cardId', {
|
|
name: 'card',
|
|
name: 'card',
|
|
action: function(params) {
|
|
action: function(params) {
|
|
|
|
+ EscapeActions.executeUpTo('popup-close');
|
|
Session.set('currentBoard', params.boardId);
|
|
Session.set('currentBoard', params.boardId);
|
|
Session.set('currentCard', params.cardId);
|
|
Session.set('currentCard', params.cardId);
|
|
- EscapeActions.executeUpTo('popup-close');
|
|
|
|
|
|
|
|
BlazeLayout.render('defaultLayout', { content: 'board' });
|
|
BlazeLayout.render('defaultLayout', { content: 'board' });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+FlowRouter.route('/shortcuts', {
|
|
|
|
+ name: 'shortcuts',
|
|
|
|
+ action: function(params) {
|
|
|
|
+ const shortcutsTemplate = 'keyboardShortcuts';
|
|
|
|
+
|
|
|
|
+ EscapeActions.executeUpTo('popup-close');
|
|
|
|
+
|
|
|
|
+ if (previousPath) {
|
|
|
|
+ Modal.open(shortcutsTemplate, {
|
|
|
|
+ onCloseGoTo: previousPath
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ // XXX There is currently no way to escape this page on Sandstorm
|
|
|
|
+ BlazeLayout.render('defaultLayout', { content: shortcutsTemplate });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+});
|
|
|
|
+
|
|
FlowRouter.notFound = {
|
|
FlowRouter.notFound = {
|
|
action: function() {
|
|
action: function() {
|
|
BlazeLayout.render('defaultLayout', { content: 'notFound' });
|
|
BlazeLayout.render('defaultLayout', { content: 'notFound' });
|