diff --git a/lib/controllers/file-patch-controller.js b/lib/controllers/file-patch-controller.js index f034bde207..10a3bc2486 100644 --- a/lib/controllers/file-patch-controller.js +++ b/lib/controllers/file-patch-controller.js @@ -20,6 +20,15 @@ export default class FilePatchController { }) this.repositoryObserver.setActiveModel(props.repository) etch.initialize(this) + + this.element.addEventListener('focus', () => { + this.focused = true + etch.update(this) + }) + this.element.addEventListener('blur', () => { + this.focused = false + etch.update(this) + }) } async update (props) { @@ -38,12 +47,13 @@ export default class FilePatchController { render () { const hunks = this.props.filePatch.getHunks() if (!hunks.length) { - return