mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
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.
27 lines
766 B
27 lines
766 B
import _ from 'underscore';
|
|
import Backbone from 'backbone';
|
|
var CreateComponent = require('./CreateComponent');
|
|
|
|
module.exports = _.extend({}, CreateComponent, {
|
|
/**
|
|
* This event is triggered at the beginning of a draw operation
|
|
* @param {Object} component Object component before creation
|
|
* @private
|
|
* */
|
|
beforeDraw(component) {
|
|
component.type = 'text';
|
|
if (!component.style) component.style = {};
|
|
component.style.padding = '10px';
|
|
},
|
|
|
|
/**
|
|
* This event is triggered at the end of a draw operation
|
|
* @param {Object} model Component model created
|
|
* @private
|
|
* */
|
|
afterDraw(model) {
|
|
if (!model || !model.set) return;
|
|
model.trigger('focus');
|
|
if (this.sender) this.sender.set('active', false);
|
|
}
|
|
});
|
|
|