Issue #716Opened January 5, 2018by krunal0393 reactions

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)

artfJanuary 5, 20182 reactions

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);
});
faruk247November 26, 20181 reactions
Code SnippetTEXT
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);
    });
lock[bot]November 26, 20190 reactions

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.