mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Make project's Git repository a window global
This allows it to operate independently of the project and mirror the availability of the root view and project.
This commit is contained in:
@@ -91,6 +91,7 @@ window.handleWindowEvents = ->
|
||||
window.buildProjectAndRootView = ->
|
||||
RootView = require 'root-view'
|
||||
Project = require 'project'
|
||||
Git = require 'git'
|
||||
|
||||
pathToOpen = atom.getPathToOpen()
|
||||
windowState = atom.getRootViewStateForPath(pathToOpen) ? {}
|
||||
@@ -102,6 +103,11 @@ window.buildProjectAndRootView = ->
|
||||
|
||||
$(rootViewParentSelector).append(rootView)
|
||||
|
||||
window.git = Git.open(project.getPath())
|
||||
project.on 'path-changed', ->
|
||||
window.git?.destroy()
|
||||
window.git = Git.open(project.getPath())
|
||||
|
||||
window.stylesheetElementForId = (id) ->
|
||||
$("head style[id='#{id}']")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user