A
A
Artur Smirnov2013-12-09 15:55:40
JavaScript
Artur Smirnov, 2013-12-09 15:55:40

Resize images in TinyMCE

Hello!
I am using TinyMCE v.4.0.8.
The editor options are object_resizing = false - that is, initially resizing is disabled.
I need that when my button is clicked, the image resizing mode is activated and resize handles are drawn.
Tried to do it like this:

tinymce.activeEditor.settings.object_resizing = true;
img.click();     // jQuery(img).trigger('click')
tinymce.activeEditor.selection.collapse();

Works in Google Chrome but doesn't work in Firefox and IE. And in general, it is wrong to generate a user event. Maybe someone will tell you the correct way to enable image editing mode in TinyMCE.
PS I also tried to select an image using selection.select(img) and selection.controlSelection.controlSelect(img) - it doesn't work.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question