diff options
author | Maxime Quandalle <maxime@quandalle.com> | 2015-06-12 13:59:39 +0200 |
---|---|---|
committer | Maxime Quandalle <maxime@quandalle.com> | 2015-06-12 17:48:15 +0200 |
commit | c8945679872a0708eb67a477a99a65d508c84cb0 (patch) | |
tree | 5cf9f2cc842f891451f7bc247b5f0833c1ab39e7 /client/components/cards/details.js | |
parent | 216887490e3be0ba141484afc11d37475e91562d (diff) | |
download | wekan-c8945679872a0708eb67a477a99a65d508c84cb0.tar.gz wekan-c8945679872a0708eb67a477a99a65d508c84cb0.tar.bz2 wekan-c8945679872a0708eb67a477a99a65d508c84cb0.zip |
Work on the card activities and comments
This commit also introduces a new CSSEvents object that is used to
abstract vendor specifics events related to CSS transitions and
animations.
Fixes #183.
Fixes #179.
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')); }, |