grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

REMOVE: How to wrap html of video component into 2 div`s, and why toHtml not called?

Open v8jupiter opened this issue 6 years ago • 1 comments

Hello, Can someone help me. v0.16.17 I need to change html for video component to structure:

<div class='1'>
     <div class='2'>
    <iframe></iframe>
</div>
</div>

I am trying to override toHtml method but they never called...

` // Get DomComponents module let comps = editor.DomComponents; let bm = editor.BlockManager;

// Get the model and the view from the default Component type let originalVideo = comps.getType('video'); let oModel = originalVideo.model;

// The input will be the Component type ID comps.addType('video', { // Define the Model model: oModel.extend({ defaults : { ...oModel.prototype.defaults, provider: 'gVideo', gVideoUrl: 'https://www.sdfsgdfgdgdfgdfgdg.com/v.php', classes: ['embed-responsive', 'embed-responsive-16by9'], tagName: 'iframe', }, toHTML() { console.log(123); }, `

v8jupiter avatar Aug 10 '20 14:08 v8jupiter

my error

v8jupiter avatar Aug 10 '20 18:08 v8jupiter