Fix the horizontal canvas scrolling on card opening

This commit is contained in:
Maxime Quandalle 2015-08-31 23:14:31 +02:00
parent 549f8fee3a
commit 0ce381aa0a
3 changed files with 45 additions and 31 deletions

View file

@ -7,12 +7,12 @@ FlowRouter.route('/', {
name: 'home',
triggersEnter: [AccountsTemplates.ensureSignedIn],
action: function() {
EscapeActions.executeAll();
Filter.reset();
Session.set('currentBoard', null);
Session.set('currentCard', null);
Filter.reset();
EscapeActions.executeAll();
BlazeLayout.render('defaultLayout', { content: 'boardList' });
}
});
@ -21,15 +21,16 @@ FlowRouter.route('/b/:id/:slug', {
name: 'board',
action: function(params) {
let currentBoard = params.id;
// If we close a card, we'll execute again this route action but we don't
// want to excape every current actions (filters, etc.)
if (Session.get('currentBoard') !== currentBoard) {
EscapeActions.executeAll();
}
let previousBoard = Session.get('currentBoard');
Session.set('currentBoard', currentBoard);
Session.set('currentCard', null);
// If we close a card, we'll execute again this route action but we don't
// want to excape every current actions (filters, etc.)
if (previousBoard !== currentBoard) {
EscapeActions.executeAll();
}
BlazeLayout.render('defaultLayout', { content: 'board' });
}
});
@ -37,10 +38,11 @@ FlowRouter.route('/b/:id/:slug', {
FlowRouter.route('/b/:boardId/:slug/:cardId', {
name: 'card',
action: function(params) {
EscapeActions.executeUpTo('inlinedForm');
Session.set('currentBoard', params.boardId);
Session.set('currentCard', params.cardId);
EscapeActions.executeUpTo('inlinedForm');
BlazeLayout.render('defaultLayout', { content: 'board' });
}
});