mirror of
https://github.com/atom/atom.git
synced 2026-02-14 16:45:14 -05:00
Window is only shutdown if a rootView and project exist
Keeping the shutdown state as a local var in window.coffee causes spec failures because window.shutdown can only be called once in the entire spec suite
This commit is contained in:
@@ -8,7 +8,6 @@ require 'underscore-extensions'
|
||||
require 'space-pen-extensions'
|
||||
|
||||
deserializers = {}
|
||||
wasShutdown = false
|
||||
|
||||
windowAdditions =
|
||||
rootViewParentSelector: 'body'
|
||||
@@ -69,8 +68,7 @@ windowAdditions =
|
||||
$(rootViewParentSelector).append(rootView)
|
||||
|
||||
shutdown: ->
|
||||
return if wasShutdown
|
||||
wasShutdown = true
|
||||
return if not project and not rootView
|
||||
atom.setWindowState('pathToOpen', project.getPath())
|
||||
atom.setRootViewStateForPath project.getPath(),
|
||||
project: project.serialize()
|
||||
@@ -78,6 +76,8 @@ windowAdditions =
|
||||
rootView.deactivate()
|
||||
project.destroy()
|
||||
$(window).off('focus blur before')
|
||||
window.rootView = null
|
||||
window.project = null
|
||||
|
||||
stylesheetElementForId: (id) ->
|
||||
$("head style[id='#{id}']")
|
||||
|
||||
Reference in New Issue
Block a user