2
0

boardArchive.js 665 B

1234567891011121314151617181920212223242526272829303132333435
  1. Template.headerTitle.events({
  2. 'click .js-open-archived-board': function() {
  3. Modal.open('archivedBoards')
  4. }
  5. })
  6. BlazeComponent.extendComponent({
  7. template() {
  8. return 'archivedBoards';
  9. },
  10. onCreated() {
  11. this.subscribe('archivedBoards')
  12. },
  13. archivedBoards() {
  14. return Boards.find({ archived: true }, {
  15. sort: ['title']
  16. })
  17. },
  18. events() {
  19. return [{
  20. 'click .js-restore-board': function() {
  21. let boardId = this.currentData()._id
  22. Boards.update(boardId, {
  23. $set: {
  24. archived: false
  25. }
  26. })
  27. Utils.goBoardId(boardId)
  28. }
  29. }]
  30. },
  31. }).register('archivedBoards')