grapesjs-clot
Version:
Free and Open Source Web Builder Framework
32 lines (27 loc) • 594 B
JavaScript
import Component from './Component';
import { toLowerCase } from 'utils/mixins';
const type = 'script';
export default Component.extend(
{
defaults: {
...Component.prototype.defaults,
type,
tagName: type,
droppable: false,
draggable: false,
layerable: false
}
},
{
isComponent(el) {
if (toLowerCase(el.tagName) == type) {
const result = { type };
if (el.src) {
result.src = el.src;
result.onload = el.onload;
}
return result;
}
}
}
);