diff options
author | Maxime Quandalle <maxime@quandalle.com> | 2015-05-14 15:21:48 +0200 |
---|---|---|
committer | Maxime Quandalle <maxime@quandalle.com> | 2015-05-14 15:21:48 +0200 |
commit | 018bb343b5eadba9b8367286634c39db454a53fa (patch) | |
tree | da4a3b7d674db7523df80d27e00cb66612713eb2 /client/components/boards | |
parent | 22b8b6ab205eb2fe7abcd3fedfc108de12ef61d9 (diff) | |
download | wekan-018bb343b5eadba9b8367286634c39db454a53fa.tar.gz wekan-018bb343b5eadba9b8367286634c39db454a53fa.tar.bz2 wekan-018bb343b5eadba9b8367286634c39db454a53fa.zip |
Fix new list form
Fixes #157.
Diffstat (limited to 'client/components/boards')
-rw-r--r-- | client/components/boards/body.jade | 6 | ||||
-rw-r--r-- | client/components/boards/body.js | 24 |
2 files changed, 24 insertions, 6 deletions
diff --git a/client/components/boards/body.jade b/client/components/boards/body.jade index 5406ee2f..4abc0baf 100644 --- a/client/components/boards/body.jade +++ b/client/components/boards/body.jade @@ -12,18 +12,18 @@ template(name="boardComponent") each lists +list(this) if currentUser.isBoardMember - +addlistForm + +addListForm +boardSidebar if currentCard +cardSidebar(currentCard) else +message(label="board-no-found") -template(name="addlistForm") +template(name="addListForm") .list.js-list.add-list.js-add-list +inlinedForm(autoclose=false) input.list-name-input(type="text" placeholder="{{_ 'add-list'}}" - autocomplete="off" autofocus) + autocomplete="off" autofocus value=getCache) div.edit-controls.clearfix button.primary.confirm.js-save-edit(type="submit") {{_ 'save'}} a.fa.fa-times.dark-hover.cancel.js-close-inlined-form diff --git a/client/components/boards/body.js b/client/components/boards/body.js index 2b4baf53..78566f2e 100644 --- a/client/components/boards/body.js +++ b/client/components/boards/body.js @@ -4,7 +4,7 @@ BlazeComponent.extendComponent({ }, openNewListForm: function() { - this.componentChildren('addlistForm')[0].open(); + this.componentChildren('addListForm')[0].open(); }, scrollLeft: function() { @@ -60,11 +60,29 @@ BlazeComponent.extendComponent({ BlazeComponent.extendComponent({ template: function() { - return 'addlistForm'; + return 'addListForm'; }, // Proxy open: function() { this.componentChildren('inlinedForm')[0].open(); + }, + + events: function() { + return [{ + submit: function(evt) { + evt.preventDefault(); + var title = this.find('.list-name-input'); + if ($.trim(title.value)) { + Lists.insert({ + title: title.value, + boardId: Session.get('currentBoard'), + sort: $('.list').length + }); + + title.value = ''; + } + } + }]; } -}).register('addlistForm'); +}).register('addListForm'); |