summaryrefslogtreecommitdiffstats
path: root/client/components/boards/boardBody.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/boards/boardBody.js')
-rw-r--r--client/components/boards/boardBody.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js
index 517e53ba..5a74e61b 100644
--- a/client/components/boards/boardBody.js
+++ b/client/components/boards/boardBody.js
@@ -34,7 +34,7 @@ BlazeComponent.extendComponent({
},
openNewListForm() {
- this.childrenComponents('addListForm')[0].open();
+ this.childComponents('addListForm')[0].open();
},
// XXX Flow components allow us to avoid creating these two setter methods by
@@ -45,7 +45,8 @@ BlazeComponent.extendComponent({
},
scrollLeft(position = 0) {
- this.$('.js-lists').animate({
+ const lists = this.$('.js-lists');
+ lists && lists.animate({
scrollLeft: position,
});
},
@@ -179,22 +180,24 @@ BlazeComponent.extendComponent({
// Proxy
open() {
- this.childrenComponents('inlinedForm')[0].open();
+ this.childComponents('inlinedForm')[0].open();
},
events() {
return [{
submit(evt) {
evt.preventDefault();
- const title = this.find('.list-name-input');
- if ($.trim(title.value)) {
+ const titleInput = this.find('.list-name-input');
+ const title = titleInput.value.trim();
+ if (title) {
Lists.insert({
- title: title.value,
+ title,
boardId: Session.get('currentBoard'),
sort: $('.list').length,
});
- title.value = '';
+ titleInput.value = '';
+ titleInput.focus();
}
},
}];