question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question]: How Do I Hide / Disable Dropzone in AM Modal

See original GitHub issue

Hello,

I’ve been reviewing the documentation and this link, trying to find the right configuration setting to disable the dropzone in the Asset Manager Modal. In my config, I have set the upload attribute to 0, and yet the dropzone still appears, is clickable, displays the system file browser, and allows me to select a file.

I would like to only allow people to select images from a pre-existing library, not upload images, but it is unclear to me how to disable this fully.

Additionally, as a side question- does the Asset Manager handle pagination of files at all? We have a pre-existing media library in our Django app that I can populate the images array with, but that list could be quite long. Breaking it up into categories will help (I’ve seen that you have instructions on how to do that), but I could still end up with a long, scrolling list of image assets.

Thanks in advance!

Best Regards, Rick Zawadzki

assetManager: { assets: images, // an array of images noAssets: '', upload: 0, uploadText: '', addBtnText: 'Not working either', dropzone: 0, openAssetsOnDrop: 0, modalTitle: 'Select an Image', }, Screen Shot 2020-07-14 at 3 10 36 PM

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
HeyWreckercommented, Jul 16, 2020

Again, thank you so much @mcottret Mathieu! I will give that a shot. You’ve been incredibly helpful and I truly do appreciate it.

Thank you for entertaining and answering my multiple questions in this singular thread. I’ll open a separate question regarding pagination in the asset manager. I suspect that I’ll have to try to use am.getContainer().insertAdjacentHTML to insert next/previous buttons to send ajax requests and update the assets.

Just as a note, the API Reference page linked to on the Asset Manager page 404s.

https://grapesjs.com/docs/modules/API-Asset-Manager

1reaction
mcottretcommented, Jul 16, 2020

I see, sorry for the misunderstanding 😃

I didn’t know about this specific behaviour, but the assets from the loaded configuration might override the initial set value. You could try updating the assets list after loading the configuration like the following:

this.editor.on('storage:load', () => {
    this.editor.AssetManager.add(images);
    this.editor.AssetManager.render(images);
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Dropzone Replace Remove file prompt confirmation with ...
the Main problem is that toogle modal not stop the remove file event to catch if user click "aceptar" or "cancelar". spanish option...
Read more >
Methods - Dropzone
If you do not need a dropzone anymore, just call .disable() on the object. This will remove all event listeners on the element,...
Read more >
FAQ · dropzone/dropzone Wiki - GitHub
Dropzone is an easy to use drag'n'drop library. ... So you can either: Turn off autoDiscover globally like this: Dropzone.
Read more >
react-dropzone
NOTE You can disable using the FS access API with the useFsAccessApi property: useDropzone({useFsAccessApi: false}) .
Read more >
Dashboard - Uppy
Enabling this option will disable drag & drop, hide the “browse” and “My Device” button, allowing only uploads from plugins, such as Webcam,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found