mirror of
https://github.com/wekan/wekan.git
synced 2026-01-15 22:15:28 +01:00
The new EscapeActions object decide what to do when the user press the Escape key (such as closing a opened popup or inlined form). This commit also re-introduced the sidebar current view as a sidebar component local state.
29 lines
690 B
JavaScript
29 lines
690 B
JavaScript
Router.configure({
|
|
loadingTemplate: 'spinner',
|
|
notFoundTemplate: 'notfound',
|
|
layoutTemplate: 'defaultLayout',
|
|
|
|
onBeforeAction: function() {
|
|
var options = this.route.options;
|
|
|
|
// Redirect logged in users to Boards view when they try to open Login or
|
|
// signup views.
|
|
if (Meteor.userId() && options.redirectLoggedInUsers) {
|
|
return this.redirect('Boards');
|
|
}
|
|
|
|
// Authenticated
|
|
if (! Meteor.userId() && options.authenticated) {
|
|
return this.redirect('atSignIn');
|
|
}
|
|
|
|
// Reset default sessions
|
|
Session.set('error', false);
|
|
|
|
Tracker.nonreactive(function() {
|
|
EscapeActions.executeLowerThan(40);
|
|
});
|
|
|
|
this.next();
|
|
}
|
|
});
|