Closed sonnylloyd closed 7 years ago
Sorry head was in the clouds yesterday. i placed the script tag in the wrong place
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I am in the middle of working on some custom components/blocks. To achieve this i have been using the api docs and using your grapejs plugins as examples. This file in particular https://github.com/artf/grapesjs-navbar/blob/master/src/components.js . The issue i have is on save and reloading of the page. the script tag runs infinity. Here is my code just in case its me.
domc.addType('iconbox', { model: defaultModel.extend({ defaults: Object.assign({}, defaultModel.prototype.defaults, { draggable: '.col', droppable: false, copyable: false, removable: false, script: function () { console.log('script is called'); }, traits: [{ type: 'select', label: 'Choose Icon', name: 'choose-icon', options: c.iconList, }, { type: 'textbox', label: 'description', name: 'description', value: c.description }, { type: 'select', label: 'Title Tag', name: 'title-tag', options: c.titeTags, } ] }), }, { isComponent: function(el) { if (hasClass(el, 'btsc-iconbox')) { return { type: 'iconbox' }; } }, }), // Define the View view: defaultType.view, });