mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
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:
16
src/atom/layout.coffee
Normal file
16
src/atom/layout.coffee
Normal 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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -8,4 +8,3 @@ class Template
|
||||
|
||||
buildView: (attributes) ->
|
||||
$(coffeekup.render(@content, attributes))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user