Codeminer42/cm42-central

View on GitHub
app/assets/javascripts/views/note_view.js

Summary

Maintainability
A
0 mins
Test Coverage
import noteTemplate from 'templates/note.ejs';

const NoteView = Backbone.View.extend({
  template: noteTemplate,

  tagName: 'div',

  className: 'note',

  events: {
    'click a.delete-note': 'deleteNote',
  },

  render: function () {
    this.$el.html(this.template({ note: this.model }));
    return this;
  },

  deleteNote: function () {
    this.model.destroy();
    this.$el.remove();
    return false;
  },
});

export default NoteView;