|
|
|
@ -4,17 +4,17 @@ function(Backbone){ |
|
|
|
return Backbone.View.extend({ |
|
|
|
|
|
|
|
initialize: function() { |
|
|
|
this.cv = this.model.get('Canvas'); |
|
|
|
this.pn = this.model.get('Panels'); |
|
|
|
this.className = this.model.config.stylePrefix + 'editor'; |
|
|
|
this.conf = this.model.config; |
|
|
|
this.className = this.conf.stylePrefix + 'editor'; |
|
|
|
this.model.on('loaded', function(){ |
|
|
|
this.pn.active(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
render: function(){ |
|
|
|
var conf = this.conf; |
|
|
|
this.$el.empty(); |
|
|
|
var conf = this.model.config; |
|
|
|
this.$cont = $(conf.el || ('body ' + conf.container)); |
|
|
|
|
|
|
|
if(conf.width) |
|
|
|
@ -23,20 +23,16 @@ function(Backbone){ |
|
|
|
if(conf.height) |
|
|
|
this.$cont.css('height', conf.height); |
|
|
|
|
|
|
|
this.model.set('$editor', this.$el); |
|
|
|
|
|
|
|
this.$cont.html(this.$el); |
|
|
|
|
|
|
|
// Canvas
|
|
|
|
if(this.cv) |
|
|
|
this.$el.append(this.cv.render()); |
|
|
|
this.$el.append(this.model.get('Canvas').render()); |
|
|
|
|
|
|
|
// Panels
|
|
|
|
if(this.pn) |
|
|
|
this.$el.append(this.pn.render()); |
|
|
|
this.$el.append(this.pn.render()); |
|
|
|
|
|
|
|
this.$el.attr('class', this.className); |
|
|
|
|
|
|
|
this.$cont.html(this.$el); |
|
|
|
|
|
|
|
return this; |
|
|
|
} |
|
|
|
}); |
|
|
|
|