Render the initial window layout programmatically with a template.

Remove layout html from the bootstrap page. Now the same page can be used for specs and the editor windows.
This commit is contained in:
Corey Johnson
2011-12-14 11:26:14 -08:00
parent 89c00ec8a6
commit 6ce5d32d83
5 changed files with 19 additions and 9 deletions

16
src/atom/layout.coffee Normal file
View File

@@ -0,0 +1,16 @@
$ = require 'jquery'
Template = require 'template'
module.exports =
class Layout extends Template
@attach: ->
view = @buildView()
$('body').append(view)
view
content: ->
link rel: 'stylesheet', href: 'static/atom.css'
div id: 'app-horizontal', ->
div id: 'app-vertical', ->
div id: 'main'

View File

@@ -1,8 +1,8 @@
# Like sands through the hourglass, so are the days of our lives.
require 'window'
window.atom = {}
Layout = require 'layout'
App = require 'app'
Event = require 'event'
ExtensionManager = require 'extension-manager'
@@ -12,6 +12,7 @@ Router = require 'router'
Settings = require 'settings'
Storage = require 'storage'
atom.layout = Layout.attach()
atom.event = new Event
# atom.on, atom.off, etc.
for name, method of atom.event

View File

@@ -8,4 +8,3 @@ class Template
buildView: (attributes) ->
$(coffeekup.render(@content, attributes))