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.
 
 
 
 

25 lines
602 B

define(['backbone', 'text!./../template/editor.html'],
function (Backbone, vTemplate) {
/**
* @class EditorView
* */
return Backbone.View.extend({
template: _.template(vTemplate),
initialize: function(o){
this.config = o.config || {};
this.pfx = this.config.stylePrefix;
},
render : function(){
var obj = this.model.toJSON();
obj.pfx = this.pfx;
this.$el.html( this.template(obj) );
this.$el.attr('class', this.pfx + 'editor-c');
this.$el.find('#'+this.pfx+'code').html(this.model.get('input'));
return this;
},
});
});