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
|
|
|
},
|
2018-06-06 20:05:44 +00:00
|
|
|
'click .js-delete-board': Popup.afterConfirm('boardDelete', function() {
|
2018-06-06 15:27:05 +00:00
|
|
|
Popup.close();
|
|
|
|
const isSandstorm = Meteor.settings && Meteor.settings.public &&
|
|
|
|
Meteor.settings.public.sandstorm;
|
|
|
|
if (isSandstorm && Session.get('currentBoard')) {
|
|
|
|
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
|
|
|
Boards.remove(currentBoard._id);
|
|
|
|
}
|
2018-08-28 23:23:24 +03:00
|
|
|
Boards.remove(this._id);
|
2018-06-06 15:27:05 +00:00
|
|
|
FlowRouter.go('home');
|
|
|
|
}),
|
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');
|