item.js 509 B

1234567891011121314151617181920212223
  1. const Mn = require('backbone.marionette');
  2. const App = require('../../main');
  3. const template = require('./item.ejs');
  4. module.exports = Mn.View.extend({
  5. template: template,
  6. tagName: 'tr',
  7. ui: {
  8. edit: 'a.edit'
  9. },
  10. events: {
  11. 'click @ui.edit': function (e) {
  12. e.preventDefault();
  13. App.Controller.showSettingForm(this.model);
  14. }
  15. },
  16. initialize: function () {
  17. this.listenTo(this.model, 'change', this.render);
  18. }
  19. });