2015-12-19 17:39:38 +01:00
|
|
|
Template.boardListHeaderBar.events({
|
2015-09-03 23:12:46 +02:00
|
|
|
'click .js-open-archived-board'() {
|
|
|
|
Modal.open('archivedBoards');
|
|
|
|
},
|
|
|
|
});
|
2015-08-23 11:09:48 +02:00
|
|
|
|
|
|
|
BlazeComponent.extendComponent({
|
|
|
|
onCreated() {
|
2015-09-03 23:12:46 +02:00
|
|
|
this.subscribe('archivedBoards');
|
2015-08-23 11:09:48 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
archivedBoards() {
|
|
|
|
return Boards.find({ archived: true }, {
|
2015-09-03 23:12:46 +02:00
|
|
|
sort: ['title'],
|
|
|
|
});
|
2015-08-23 11:09:48 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
events() {
|
|
|
|
return [{
|
2015-09-03 23:12:46 +02:00
|
|
|
'click .js-restore-board'() {
|
2017-07-25 00:30:30 +01:00
|
|
|
// TODO : Make isSandstorm variable global
|
|
|
|
const isSandstorm = Meteor.settings && Meteor.settings.public &&
|
|
|
|
Meteor.settings.public.sandstorm;
|
|
|
|
if (isSandstorm && Session.get('currentBoard')) {
|
|
|
|
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
|
|
|
currentBoard.archive();
|
|
|
|
}
|
2015-09-08 20:19:42 +02:00
|
|
|
const board = this.currentData();
|
|
|
|
board.restore();
|
|
|
|
Utils.goBoardId(board._id);
|
2015-09-03 23:12:46 +02:00
|
|
|
},
|
|
|
|
}];
|
2015-08-23 11:09:48 +02:00
|
|
|
},
|
2015-09-03 23:12:46 +02:00
|
|
|
}).register('archivedBoards');
|