| 77 | } |
| 78 | |
| 79 | openPatchModal (e) { |
| 80 | const row = $(e.target).closest('.patch-row') |
| 81 | const patch = _.find(this.patches.models, { id: row.data('patch-id') }) |
| 82 | const modal = new PatchModal(patch, this.model) |
| 83 | this.openModalView(modal) |
| 84 | this.listenTo(modal, 'accepted-patch', function (attrs) { return this.trigger('accepted-patch', attrs) }) |
| 85 | return this.listenTo(modal, 'hide', function () { |
| 86 | const f = () => this.reloadPatches() |
| 87 | setTimeout(f, 400) |
| 88 | return this.stopListening(modal) |
| 89 | }) |
| 90 | } |
| 91 | } |
| 92 | PatchesView.initClass() |
| 93 | return PatchesView |