From e37702d371b459847a43f7c6f953dff31684d823 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 12 Jun 2014 17:19:11 -0400 Subject: media viewer appears --- public/assets/javascripts/ui/editor/EditorView.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 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 7cabeb7..1093c76 100644 --- a/public/assets/javascripts/ui/editor/EditorView.js +++ b/public/assets/javascripts/ui/editor/EditorView.js @@ -2,7 +2,8 @@ var EditorView = View.extend({ el: "#editorView", - action: "/api/layouts/", + projecttAction: "/api/projects/", + layoutAction: "/api/layouts/", events: { }, @@ -10,25 +11,21 @@ var EditorView = View.extend({ initialize: function(){ this.toolbar = new EditorToolbar ({ parent: this }) this.settings = new EditorSettings ({ parent: this }) + this.mediaViewer = new MediaViewer ({ parent: this }) + this.mediaUpload = new MediaUpload ({ parent: this }) }, 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)) + loadLayout: function(layout){ + layout = sanitize(layout) + $.get(this.layoutAction + layout, $.proxy(this.ready, this)) }, ready: function(data){ $("#map").hide() - this.settings.load(data) + this.settings.loadLayout(data) }, }) -- cgit v1.2.3-70-g09d2