2
0

header.js 549 B

12345678910111213141516171819202122232425
  1. BlazeComponent.extendComponent({
  2. template: function() {
  3. return 'listHeader';
  4. },
  5. editTitle: function(evt) {
  6. evt.preventDefault();
  7. var form = this.componentChildren('inlinedForm')[0];
  8. var newTitle = form.getValue();
  9. if ($.trim(newTitle)) {
  10. Lists.update(this.currentData()._id, {
  11. $set: {
  12. title: newTitle
  13. }
  14. });
  15. }
  16. },
  17. events: function() {
  18. return [{
  19. 'click .js-open-list-menu': Popup.open('listAction'),
  20. submit: this.editTitle
  21. }];
  22. }
  23. }).register('listHeader');