grapesjs-preset-newsletter
grapesjs-preset-newsletter copied to clipboard
[Feature]Make the option importPlaceholder to accept functions as well
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 || '');