sidebarArchives.js 674 B

1234567891011121314151617181920212223242526
  1. BlazeComponent.extendComponent({
  2. template: function() {
  3. return 'archivesSidebar';
  4. },
  5. archivedCards: function() {
  6. return Cards.find({archived: true});
  7. },
  8. onRendered: function() {
  9. //XXX We should support dragging a card from the sidebar to the board
  10. },
  11. events: function() {
  12. return [{
  13. 'click .js-restore': function() {
  14. var cardId = this.currentData()._id;
  15. Cards.update(cardId, {$set: {archived: false}});
  16. },
  17. 'click .js-delete': Popup.afterConfirm('cardDelete', function() {
  18. var cardId = this._id;
  19. Cards.remove(cardId);
  20. Popup.close();
  21. })
  22. }];
  23. }
  24. }).register('archivesSidebar');