summaryrefslogtreecommitdiffstats
path: root/client/components/boards/boardsList.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-06-29 07:47:57 -0400
committerLauri Ojansivu <x@xet7.org>2019-06-29 07:47:57 -0400
commitb84dc20ded0375d9ab14ec05c78b737398d76b83 (patch)
treec3b91b3657299c779e941a1257df17bb0eade866 /client/components/boards/boardsList.js
parent100288b3e1bce882ab9923a5bff7b5f620f33ee8 (diff)
parent3eb4d2c341b712268bd321173909e0a7b19a88c9 (diff)
downloadwekan-b84dc20ded0375d9ab14ec05c78b737398d76b83.tar.gz
wekan-b84dc20ded0375d9ab14ec05c78b737398d76b83.tar.bz2
wekan-b84dc20ded0375d9ab14ec05c78b737398d76b83.zip
Merge branch 'linting' of https://github.com/justinr1234/wekan into justinr1234-linting
Diffstat (limited to 'client/components/boards/boardsList.js')
-rw-r--r--client/components/boards/boardsList.js94
1 files changed, 50 insertions, 44 deletions
diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js
index 0fb80230..cc586b1f 100644
--- a/client/components/boards/boardsList.js
+++ b/client/components/boards/boardsList.js
@@ -21,11 +21,14 @@ BlazeComponent.extendComponent({
},
boards() {
- return Boards.find({
- archived: false,
- 'members.userId': Meteor.userId(),
- type: 'board',
- }, { sort: ['title'] });
+ return Boards.find(
+ {
+ archived: false,
+ 'members.userId': Meteor.userId(),
+ type: 'board',
+ },
+ { sort: ['title'] },
+ );
},
isStarred() {
const user = Meteor.user();
@@ -48,46 +51,49 @@ BlazeComponent.extendComponent({
},
events() {
- return [{
- 'click .js-add-board': Popup.open('createBoard'),
- 'click .js-star-board'(evt) {
- const boardId = this.currentData()._id;
- Meteor.user().toggleBoardStar(boardId);
- evt.preventDefault();
- },
- 'click .js-clone-board'(evt) {
- Meteor.call('cloneBoard',
- this.currentData()._id,
- Session.get('fromBoard'),
- (err, res) => {
- if (err) {
- this.setError(err.error);
- } else {
- Session.set('fromBoard', null);
- Utils.goBoardId(res);
+ return [
+ {
+ 'click .js-add-board': Popup.open('createBoard'),
+ 'click .js-star-board'(evt) {
+ const boardId = this.currentData()._id;
+ Meteor.user().toggleBoardStar(boardId);
+ evt.preventDefault();
+ },
+ 'click .js-clone-board'(evt) {
+ Meteor.call(
+ 'cloneBoard',
+ this.currentData()._id,
+ Session.get('fromBoard'),
+ (err, res) => {
+ if (err) {
+ this.setError(err.error);
+ } else {
+ Session.set('fromBoard', null);
+ Utils.goBoardId(res);
+ }
+ },
+ );
+ evt.preventDefault();
+ },
+ 'click .js-archive-board'(evt) {
+ const boardId = this.currentData()._id;
+ Meteor.call('archiveBoard', boardId);
+ evt.preventDefault();
+ },
+ 'click .js-accept-invite'() {
+ const boardId = this.currentData()._id;
+ Meteor.user().removeInvite(boardId);
+ },
+ 'click .js-decline-invite'() {
+ const boardId = this.currentData()._id;
+ Meteor.call('quitBoard', boardId, (err, ret) => {
+ if (!err && ret) {
+ Meteor.user().removeInvite(boardId);
+ FlowRouter.go('home');
}
- }
- );
- evt.preventDefault();
- },
- 'click .js-archive-board'(evt) {
- const boardId = this.currentData()._id;
- Meteor.call('archiveBoard', boardId);
- evt.preventDefault();
- },
- 'click .js-accept-invite'() {
- const boardId = this.currentData()._id;
- Meteor.user().removeInvite(boardId);
- },
- 'click .js-decline-invite'() {
- const boardId = this.currentData()._id;
- Meteor.call('quitBoard', boardId, (err, ret) => {
- if (!err && ret) {
- Meteor.user().removeInvite(boardId);
- FlowRouter.go('home');
- }
- });
+ });
+ },
},
- }];
+ ];
},
}).register('boardList');