Not allow selective Image resize
Question
I do not want user to resize image on specific area of template, but want to allow anywhere on canvas.
I want user to just choose image and does not allow to resize for specific class/element.
Answers (3)
You probably need to do something like this on render
const wrapper = editor.DomComponents.getWrapper();
wrapper.view.$el.find('#someid img').each((el, i, $els) => {
const $el = $els.eq(i);
const model = $el.data('model');
model && model.set('resizable', 0);
});
each((el, i, $els), it create error. Just replace by each( function(el, i, $els)
complete code:
var wrappers = editor.DomComponents.getWrapper();
wrappers.view.$el.find('.rm-editable img').each( function(el, i, $els) {
var $el = $els.eq(i);
var model = $el.data('model');
model && model.set('resizable', 0);
});This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2003
[Question] How to select a specific element nested inside a template
My test case: https://codepen.io/jogai/pen/QRjKyN?editors=1111 I want to select the middle column so I thought I can use selectorManager.ge...
Issue #482
Default asset manager in custom component
I am in process to create custom component for below template and we want to have user enter text,link,hover text and select image and want...
Issue #795
editor.getSelected() in run:open-assets
Hello! I want without having to create a new block button, and stopping the event associated to the image that this run:open-assets get the...
Issue #1090
How to remove toolbar icons
Hi artf, Please let me know how we can remove the toolbar icons like when user click on image element then I don't want delete icon or othe...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Related tutorials
In-depth guides on the same topic.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.