diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-01-24 15:16:13 +0100 |
---|---|---|
committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-01-24 20:51:38 +0100 |
commit | 416b17062e57f215206e93a85b02ef9eb1ab4902 (patch) | |
tree | fda49dbeb9edeb91a5b4916abe45c849e7b1f540 /client/components/swimlanes/swimlaneHeader.js | |
parent | dd88eb4cc191a06f7eb84213b026dfb93546f245 (diff) | |
download | wekan-416b17062e57f215206e93a85b02ef9eb1ab4902.tar.gz wekan-416b17062e57f215206e93a85b02ef9eb1ab4902.tar.bz2 wekan-416b17062e57f215206e93a85b02ef9eb1ab4902.zip |
Remove the 'Add Swimlane' entry and replace it by a plus sign
Still need to create the swimlane right after the one that has been
created
Diffstat (limited to 'client/components/swimlanes/swimlaneHeader.js')
-rw-r--r-- | client/components/swimlanes/swimlaneHeader.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/client/components/swimlanes/swimlaneHeader.js b/client/components/swimlanes/swimlaneHeader.js index 50635f86..72437ba4 100644 --- a/client/components/swimlanes/swimlaneHeader.js +++ b/client/components/swimlanes/swimlaneHeader.js @@ -11,6 +11,7 @@ BlazeComponent.extendComponent({ events() { return [{ 'click .js-open-swimlane-menu': Popup.open('swimlaneAction'), + 'click .js-open-add-swimlane-menu': Popup.open('swimlaneAdd'), submit: this.editTitle, }]; }, @@ -23,3 +24,30 @@ Template.swimlaneActionPopup.events({ Popup.close(); }, }); + +BlazeComponent.extendComponent({ + events() { + return [{ + submit(evt) { + evt.preventDefault(); + const titleInput = this.find('.swimlane-name-input'); + const title = titleInput.value.trim(); + if (title) { + Swimlanes.insert({ + title, + boardId: Session.get('currentBoard'), + // XXX we should insert the swimlane right after the caller + sort: $('.swimlane').length, + }); + + titleInput.value = ''; + titleInput.focus(); + } + // XXX ideally, we should move the popup to the newly + // created swimlane so a user can add more than one swimlane + // with a minimum of interactions + Popup.close(); + }, + }]; + }, +}).register('swimlaneAddPopup'); |