diff options
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'); |