grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

[Bug]: Cannot disable asset-manager

Open BerkeAras opened this issue 6 years ago • 2 comments

GrapesJS Version: 0.16.18 Client: Windows 10 1909; Brave Chromium (latest) Expected behavior: It should be possible to disable the asset-manager Current behavior: Asset manager is not disabled using this code:

...
assetManager: {
     upload: false
},
...

Full code: https://pastebin.berkearas.de/?44ff08e13bab068d#5AuNABBrvbkcYp8zh5r59jkmtqJQcsuTj5jSfykMVGxd Live demo: https://codesandbox.io/s/jolly-river-p8zkt?file=/index.js

BerkeAras avatar Jul 01 '20 18:07 BerkeAras

Hi @BerkeAras !

I don't think there's currently a way to completely disable the Asset Manager, you should however be able to disable adding images.

Setting the upload option to false only disables uploading of images, but not base64 embedding. Which is why images can still be added.

Also disabling base64 embedding like the following might be the closest you can get:

assetManager: {
    upload: false,
    autoAdd: false,
    embedAsBase64: false
}

mcottret avatar Jul 02 '20 09:07 mcottret

@mcottret is right but if you'd like also to disable the opening of the Asset Manager modal you can overwrite its command in this way:

editor.Commands.add('open-assets', () => console.log('do nothing'));

artf avatar Jul 14 '20 11:07 artf