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.
 
 
 
 

55 lines
1.1 KiB

define(function(require) {
return function(){
var c = {},
defaults = require('./config/config'),
Traits = require('./model/Traits'),
TraitsView = require('./view/TraitsView');
var sectors, SectView;
return {
TraitsView: TraitsView,
/**
* Name of the module
* @type {String}
* @private
*/
name: 'TraitManager',
/**
* Initialize module. Automatically called with a new instance of the editor
* @param {Object} config Configurations
*/
init: function(config) {
c = config || {};
for (var name in defaults) {
if (!(name in c))
c[name] = defaults[name];
}
var ppfx = c.pStylePrefix;
if(ppfx)
c.stylePrefix = ppfx + c.stylePrefix;
sectors = new Traits(c.traits);
TraitView = new TraitsView({
collection: sectors,
target: c.em,
config: c,
});
return this;
},
/**
* Render sectors and properties
* @return {HTMLElement}
* */
render: function(){
return SectView.render().el;
},
};
};
});