mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Trying to clean up document handlers.
This commit is contained in:
@@ -19,6 +19,12 @@ class Document extends Pane
|
||||
@register: (test) ->
|
||||
Document.handlers[@name] = {test, handler: this}
|
||||
|
||||
@forURL: ->
|
||||
if handler = @handler window.url
|
||||
new handler
|
||||
else
|
||||
throw "I DON'T KNOW ABOUT #{window.url}"
|
||||
|
||||
constructor: ->
|
||||
|
||||
open: (path) ->
|
||||
|
||||
@@ -33,10 +33,7 @@ atom.app = new App
|
||||
for name, method of atom.app
|
||||
atom[name] = atom.app[name]
|
||||
|
||||
if handler = Document.handler window.url
|
||||
atom.document = new handler
|
||||
atom.document.open window.url
|
||||
else
|
||||
throw "I DON'T KNOW ABOUT #{window.url}"
|
||||
atom.document = Document.forURL window.url
|
||||
atom.document.open window.url
|
||||
|
||||
window.startup()
|
||||
|
||||
Reference in New Issue
Block a user