diff options
Diffstat (limited to 'client/components/cards/details.js')
-rw-r--r-- | client/components/cards/details.js | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/client/components/cards/details.js b/client/components/cards/details.js index f3d03793..05da2053 100644 --- a/client/components/cards/details.js +++ b/client/components/cards/details.js @@ -4,7 +4,7 @@ BlazeComponent.extendComponent({ }, mixins: function() { - return [Mixins.InfiniteScrolling]; + return [Mixins.InfiniteScrolling, Mixins.PerfectScrollbar]; }, calculateNextPeak: function() { @@ -35,8 +35,19 @@ BlazeComponent.extendComponent({ }); }, + onCreated: function() { + this.isLoaded = new ReactiveVar(false); + }, + events: function() { - return [{ + // XXX We can't define this event directly in the event map below because we + // miss ES6 object keys interpolation. + var events = {}; + events[CSSEvents.animationend + ' .js-card-details'] = function() { + this.isLoaded.set(true); + }; + + return [_.extend(events, { 'click .js-close-card-details': function() { Utils.goBoardId(this.data().boardId); }, @@ -60,7 +71,7 @@ BlazeComponent.extendComponent({ 'mouseenter .js-card-details': function() { this.componentParent().showOverlay.set(true); } - }]; + })]; } }).register('cardDetails'); @@ -78,11 +89,7 @@ Template.cardDetailsActionsPopup.events({ }); Popup.close(); }, - 'click .js-delete': Popup.afterConfirm('cardDelete', function() { - var cardId = this._id; - Cards.remove(cardId); - Popup.close(); - }) + 'click .js-more': Popup.open('cardMore') }); Template.moveCardPopup.events({ @@ -100,6 +107,14 @@ Template.moveCardPopup.events({ } }); +Template.cardMorePopup.events({ + 'click .js-delete': Popup.afterConfirm('cardDelete', function() { + Popup.close(); + Cards.remove(this._id); + Utils.goBoardId(this.board()._id); + }) +}); + // Close the card details pane by pressing escape EscapeActions.register('detailsPane', function() { Utils.goBoardId(Session.get('currentBoard')); }, |