wekan/client/components/sidebar/sidebar.js
Maxime Quandalle 781577db04 Experiment new ergonomics to interact with card details
The idea is that by displaying card details in a sidebar stuck on the
right of the screen, the mouse had to travel too much before
interacting with it. I also don’t want to use the Trello solution
(modal) on big screens, because I like the ability to interact with
the selected card and with the board at the same time (like in a
e-mail client).

The solution introduced in this commit consist of opening the card
detail in a column next to the minicard list.

This commit also fix right sidebar members and labels drag and drop.
2015-05-24 22:11:40 +02:00

56 lines
1.2 KiB
JavaScript

BlazeComponent.extendComponent({
template: function() {
return 'boardSidebar';
},
mixins: function() {
return [Mixins.InfiniteScrolling];
},
onCreated: function() {
this._isOpen = new ReactiveVar(! Session.get('currentCard'));
Sidebar = this;
},
isOpen: function() {
return this._isOpen.get();
},
open: function() {
if (! this._isOpen.get()) {
this._isOpen.set(true);
}
},
hide: function() {
if (this._isOpen.get()) {
this._isOpen.set(false);
}
},
toogle: function() {
this._isOpen.set(! this._isOpen.get());
},
calculateNextPeak: function() {
var altitude = this.find('.js-board-sidebar-content').scrollHeight;
this.callFirstWith(this, 'setNextPeak', altitude);
},
reachNextPeak: function() {
var activitiesComponent = this.componentChildren('activities')[0];
activitiesComponent.loadNextPage();
},
isTongueHidden: function() {
return this.isOpen() && Filter.isActive();
},
events: function() {
// XXX Hacky, we need some kind of `super`
var mixinEvents = this.getMixin(Mixins.InfiniteScrolling).events();
return mixinEvents.concat([{
'click .js-toogle-sidebar': this.toogle
}]);
}
}).register('boardSidebar');