diff options
Diffstat (limited to 'client/components/lists/header.js')
-rw-r--r-- | client/components/lists/header.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/client/components/lists/header.js b/client/components/lists/header.js new file mode 100644 index 00000000..014cfd80 --- /dev/null +++ b/client/components/lists/header.js @@ -0,0 +1,25 @@ +BlazeComponent.extendComponent({ + template: function() { + return 'listHeader'; + }, + + editTitle: function(evt) { + evt.preventDefault(); + var form = this.componentChildren('inlinedForm')[0]; + var newTitle = form.getValue(); + if ($.trim(newTitle)) { + Lists.update(this.currentData()._id, { + $set: { + title: newTitle + } + }); + } + }, + + events: function() { + return [{ + 'click .js-open-list-menu': Popup.open('listAction'), + submit: this.editTitle + }]; + } +}).register('listHeader'); |