Button switcher to editor.allowsCripts
Question
Hello, @artf ! :) Maybe you can help with grapesjs. I have buttons which has own scripts(e.g. opening modal window by click). And if I set property allowScripts: 0 - I can to edit these buttons, but if editor.allowScripts == 1, buttons execute logic(e.g. opening modal window) and I can't to edit buttons in that case. I found a great solution - it's switch property allowScripts = 0 : 1, but changes are only applied after page reload. How can I switch scripts? p.s execute command editor.refresh() after change a value allowScripts does not bring results

Answers (2)
I'd recommend creating a custom component for those buttons to handle the logic with scripts
@artf thank you very much! :+1:
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1836
How to add !important in all the generated apis
Hello @artf, While i am going to edit some html from editor with the help of css then i need to add !important into all the css which is ch...
Issue #2972
FEAT: Disable scripts on canvas
Hello, first of all thanks for a great tool. On my project i hit the problem where I need to disable scripts inside the editor. I found 2 s...
Issue #386
Extend Pannel/Command examples/documentation with opening a new view
Hi Artur, First of all grapesjs is awsome! At the moment i am trying to puzzle together how to create a pannel with a button that opens a n...
Issue #2148
[QUESTION] IE11 (Unable to get property 'style' of undefined)
Hi! Just faced the same issue: https://github.com/artf/grapesjs/issues/1295#issuecomment-410046832 While click on one of this buttons this....
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.