Customize image resizing
Question
If i want to limit resizing an image to only specific dimensions, how can i do that? Also is it possible to enable resizing only from the bottom right corner and disable from the other corners and points?
Answers (3)
How can I update these properties if I'm using the grapesjs-preset-webpage?
You can always update a component type (but do it as a plugin)
editor.DomComponents.addType('image', {
model: {
defaults: {
resizable: {
tl: 0, // Top left
tc: 0, // Top center
tr: 0, // Top right
cl: 0, // Center left
bl: 0, // Bottom left
}
}
}
})
You can use this options for the resizable property of components
How can I update these properties if I'm using the grapesjs-preset-webpage?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1868
How to enable functionality only for specific image component, not all
I've enabled the fa fa-pencil icon into my image components, but I want it to be enabled only in specific image components, not all of them...
Issue #1322
Disable editing in Preview Mode.
@artf How can we disable editing in the preview mode and re-enable it when preview mode off. I want to remove editor and hide toolbar in th...
Issue #735
When resizing images in the same section, they all resize...
I'm encountering a strange bug, when resizing a single image, the sibling photo is also being resized. My only thought is around how the co...
Issue #1325
How to disable drop for specific blocks/components
Hello, with the following code we are able to indicate if it's possible to drop other component(blocks) inside that particular component......
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.