summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/editor/EditorView.js
blob: 7cabeb77bcea5b2e62b0e43c82eeaa913ff29f0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var EditorView = View.extend({
	el: "#editorView",
	
	action: "/api/layouts/",

	events: {
	},
	
	initialize: function(){
		this.toolbar = new EditorToolbar ({ parent: this })
		this.settings = new EditorSettings ({ 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))
	},
	
	ready: function(data){
		$("#map").hide()
		this.settings.load(data)
	},

})