grapesjs-preset-newsletter icon indicating copy to clipboard operation
grapesjs-preset-newsletter copied to clipboard

[Feature]Make the option importPlaceholder to accept functions as well

Open IceCrystal0k opened this issue 6 years ago • 0 comments

in openImportCommand, there is this line: codeViewer.setContent(opt.importPlaceholder || '');

In order to set the content import placeholder dynamically, it would be useful to check if it is a function then return the result of the function, otherwise use it as a variable. So it could be:

var importPlaceholder = (typeof opt.importPlaceholder === 'function') ? opt.importPlaceholder() : opt.importPlaceholder;
codeViewer.setContent(importPlaceholder || '');

IceCrystal0k avatar Jul 31 '18 12:07 IceCrystal0k