image
image copied to clipboard
Pass remove lifecycle hook to config.onRemove
Called onRemove function in remove life cycle hook.
removed() {
this.config.onRemove(this.data);
}
Usage
- Replace the contents of
node-modules/@editorjs/image/dist/bundle.js
bydist/bundle.js
of this repository.
{
image: {
class: Image,
config: {
onRemove: data => console.log(data)
}
// other config options
}
PS: I don't think this would be merged with read-only branch, but this works great as a workaround.
Hi @MohitKS5!
Thank you for your pull request. Before merging please complete the following things in PR:
- Update version package.json
- Update README.md according to changes
- Build the image tool using
yarn build
for production mode
I did the changes. Is specifying @param {object}
and providing link to format (output data section) is sufficient or should I re-describe it in the section ?
pulled master and rebuilt for production. The only conflict was package.json
version. There are warnings on build but I didn't introduce any new warning. I checked by building the master itself.
Still has conflicts
Sorry, I forgot to check the upstream, pulled master of my own fork only. Its fixed now.
Hi @MohitKS5, Please Resolve the conflicts and change version in package.json again
@robonetphy done.
Is this still being worked on?🥲
look forward
Called onRemove function in remove life cycle hook.
removed() { this.config.onRemove(this.data); }
Will these changes be included in the main thread in the repository?