From 5a215e1b00e4fd026a83e81baa7a45c28435f73c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 12 Jun 2014 14:52:34 -0400 Subject: routes for starting a new project --- public/assets/javascripts/ui/editor/EditorView.js | 28 ++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'public/assets/javascripts/ui/editor/EditorView.js') diff --git a/public/assets/javascripts/ui/editor/EditorView.js b/public/assets/javascripts/ui/editor/EditorView.js index 91329de..7cabeb7 100644 --- a/public/assets/javascripts/ui/editor/EditorView.js +++ b/public/assets/javascripts/ui/editor/EditorView.js @@ -1,13 +1,35 @@ var EditorView = View.extend({ -// el: "#editorControls", + el: "#editorView", + + action: "/api/layouts/", events: { }, + + initialize: function(){ + this.toolbar = new EditorToolbar ({ parent: this }) + this.settings = new EditorSettings ({ parent: this }) + }, - load: function(){ + load: function(name){ + }, + + loadLayout: function(name){ + if (! name || name == "new") { + this.ready({ isNew: true, _id: "new", name: "" }) + return + } + + name = sanitize(name) + + $.get(this.action + name, $.proxy(this.ready, this)) + }, + + ready: function(data){ $("#map").hide() - } + this.settings.load(data) + }, }) -- cgit v1.2.3-70-g09d2