nobody
nobody

Reputation: 11

CKEditor 4 image preview: programmatically setting dimensions

I am adding plus / minus icon buttons to the CKEditor image properties preview for a user to click on them and increase / decrease the image width and height by a fixed number of pixels without having to type in the values.

I see that the keyup event updates the image preview as well as the lock ratio. How to correctly simulate the required keyup event in JavaScript / jQuery after the new pixel value has been set in the width / height input fields?

enter image description here

Upvotes: 0

Views: 152

Answers (1)

nobody
nobody

Reputation: 11

Something like the following works:

my_input.dispatchEvent(new KeyboardEvent('keyup', {
                'key': '1'
              }));

Upvotes: 0

Related Questions