summaryrefslogtreecommitdiffstats
path: root/client/components/swimlanes/swimlanes.js
diff options
context:
space:
mode:
authorAndrés Manelli <andresmanelli@gmail.com>2018-01-19 16:00:02 -0300
committerAndrés Manelli <andresmanelli@gmail.com>2018-01-19 16:00:02 -0300
commitee2a43dd5b4b5296f61f68b46fd85521224f571d (patch)
tree124f6eedc070ba926b8dc3f47985bb6951be3d92 /client/components/swimlanes/swimlanes.js
parent690a5b970319ceabc0be965152187d7098022621 (diff)
downloadwekan-ee2a43dd5b4b5296f61f68b46fd85521224f571d.tar.gz
wekan-ee2a43dd5b4b5296f61f68b46fd85521224f571d.tar.bz2
wekan-ee2a43dd5b4b5296f61f68b46fd85521224f571d.zip
Add siwmlane button. Allow card drop between swimlanes
Diffstat (limited to 'client/components/swimlanes/swimlanes.js')
-rw-r--r--client/components/swimlanes/swimlanes.js63
1 files changed, 63 insertions, 0 deletions
diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js
index 9388be3a..5c2429dd 100644
--- a/client/components/swimlanes/swimlanes.js
+++ b/client/components/swimlanes/swimlanes.js
@@ -174,6 +174,69 @@ BlazeComponent.extendComponent({
},
}).register('addListForm');
+BlazeComponent.extendComponent({
+ // Proxy
+ open() {
+ this.childComponents('inlinedForm')[0].open();
+ },
+
+ events() {
+ return [{
+ submit(evt) {
+ evt.preventDefault();
+ var titleInput = this.find('.list-name-input');
+ if (titleInput) {
+ const title = titleInput.value.trim();
+ if (title) {
+ Lists.insert({
+ title,
+ boardId: Session.get('currentBoard'),
+ sort: $('.list').length,
+ });
+
+ titleInput.value = '';
+ titleInput.focus();
+ }
+ } else {
+ titleInput = this.find('.swimlane-name-input');
+ const title = titleInput.value.trim();
+ console.log(title);
+ if (title) {
+ Swimlanes.insert({
+ title,
+ boardId: Session.get('currentBoard'),
+ sort: $('.swimlane').length,
+ });
+
+ titleInput.value = '';
+ titleInput.focus();
+ }
+ }
+ },
+ }];
+ },/*
+ if (titleInput) {
+ const title = titleInput.value.trim();
+ if (title) {
+ Lists.insert({
+ title,
+ boardId: Session.get('currentBoard'),
+ sort: $('.list').length,
+ });
+
+ titleInput.value = '';
+ titleInput.focus();
+ }
+ } else {
+ titleInput = this.find('.swimlane-name-input');
+ console.log(titleInput);
+ }
+ },
+ }];
+ },
+ */
+}).register('addListAndSwimlaneForm');
+
Template.swimlane.helpers({
canSeeAddList() {
return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();