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/body.js | |
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/body.js')
-rw-r--r-- | client/components/boards/body.js | 24 |
1 files changed, 21 insertions, 3 deletions
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'); |