Trying to clean up document handlers.

This commit is contained in:
Corey Johnson
2011-11-11 13:10:28 -08:00
parent d78d124d69
commit b76c2f7f7e
2 changed files with 8 additions and 5 deletions

View File

@@ -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) ->

View File

@@ -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()