Free and Open source Web Builder Framework. Next generation tool for building templates without coding
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

32 lines
793 B

define(['backbone','./FrameView'],
function(Backbone, FrameView) {
/**
* @class CanvasView
* */
return Backbone.View.extend({
initialize: function(o) {
this.config = o.config;
this.className = this.config.stylePrefix + 'canvas';
this.frame = new FrameView({
model: this.model.get('frame')
});
},
render: function() {
this.wrapper = this.model.get('wrapper');
if(this.wrapper && typeof this.wrapper.render == 'function'){
this.model.get('frame').set('wrapper', this.wrapper);
var wrap = this.wrapper.render();
this.$el.append(this.frame.render().el);
var frame = this.frame;
frame.el.onload = function(){ frame.renderWrapper(); };
}
this.$el.attr({class: this.className, id: this.config.canvasId});
return this;
},
});
});