Update document edited status in workspace model

This also fixes a previous oversight where the status wasn’t updated
when switching between pane items with different modified status.
This commit is contained in:
Nathan Sobo
2014-09-24 17:00:05 -06:00
parent 28deb9dec5
commit ae488fc7fe
3 changed files with 66 additions and 21 deletions

View File

@@ -107,8 +107,6 @@ class WorkspaceView extends View
@subscribe $(window), 'focus', (e) =>
@handleFocus(e) if document.activeElement is document.body
@on 'pane:active-item-modified-status-changed', '.active.pane', => @updateDocumentEdited()
@command 'application:about', -> ipc.send('command', 'application:about')
@command 'application:run-all-specs', -> ipc.send('command', 'application:run-all-specs')
@command 'application:run-benchmarks', -> ipc.send('command', 'application:run-benchmarks')
@@ -344,12 +342,6 @@ class WorkspaceView extends View
confirmClose: ->
@model.confirmClose()
# On OS X, fades the application window's proxy icon when the current file
# has been modified.
updateDocumentEdited: ->
modified = @model.getActivePaneItem()?.isModified?() ? false
atom.setDocumentEdited(modified)
# Get all editor views.
#
# You should prefer {Workspace::getEditors} unless you absolutely need access