-
-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use with existing file manager #56
Comments
@newelement i am facing the same issue right now. I have implemented a Well going through the source now though. If i get something cool from there i will definitely open a pull request for the functionality. |
+1 Any updates guys? |
Hi, You can achieve that by adding to the Let's say I have a new method then in
If you want a concrete example, refer to this post on ProcessWire forum : Load IFrame Native Image Picker |
This config option, if passed will be invoked on clicking "select an image". This callback receive the current imageTool as parameter, in order to permit user carry call methods like onUpload with the response object (`{ success: true, file: ... }`) This should close editor-js#56
Hello @newelement, I opened the above pull request which will permit us do the following, hope it helps. I use this on my website, and it works perfectly. const imageToolConfig = {
class: EditorJSImage,
config: {
onSelectFile: tool => {
toggleLibrary(img => {
const data = tool.data;
data.file = img; // set image
data.caption = data.caption || img.meta;
tool.data = data;
toggleLibrary(undefined);
});
},
uploader: {
uploadByFile: ...
uploadByUrl: ...
}
}
} |
Would be nice feature indeed |
@mernxl Hi could you please provide an example for toggleLibrary? |
Sorry is this is obvious, but I cannot wrap my head around making custom blocks. I have an existing file manager in a CMS I'm working on. Is there a callback I can use to insert a block with the image I pick from my file manager?
The text was updated successfully, but these errors were encountered: