mirror of https://github.com/artf/grapesjs.git
4 changed files with 37 additions and 0 deletions
@ -0,0 +1,24 @@ |
|||
const Component = require('./ComponentTextNode'); |
|||
|
|||
module.exports = Component.extend( |
|||
{ |
|||
defaults: { |
|||
...Component.prototype.defaults |
|||
}, |
|||
|
|||
toHTML() { |
|||
return `<!--${this.get('content')}-->`; |
|||
} |
|||
}, |
|||
{ |
|||
isComponent(el) { |
|||
if (el.nodeType == 8) { |
|||
return { |
|||
tagName: 'NULL', |
|||
type: 'comment', |
|||
content: el.textContent |
|||
}; |
|||
} |
|||
} |
|||
} |
|||
); |
|||
@ -0,0 +1,7 @@ |
|||
const ComponentView = require('./ComponentTextNodeView'); |
|||
|
|||
module.exports = ComponentView.extend({ |
|||
_createElement() { |
|||
return document.createComment(this.model.get('content')); |
|||
} |
|||
}); |
|||
Loading…
Reference in new issue