Image Attributes plugin: Odd behaviour when we got 2 (or more) images on the editor
The image attribute plugin's dialog box is showing values of the previous image, if more than 1 images are on the same page and the first image is having a Link URL being set
How to replicate:
- Add 2 images
- Add a link URL on the first image
- Double click the image attributes on the 2nd image. The Link URL is prepopulated with the URL of the first image. At this point, the actual HTML code is not being altered. However, If i accidentally press OK on the dialog form, the HTML code will be updated with the same Link URL of the first image.
It looks like that the plugin reads the imgLink
data (thus the URL and the rest of the variables) of the first image it can find and populates the dialog form without checking which image it should be reading.
Reported also on: https://github.com/DiemenDesign/summernote-image-attributes/issues/77
Proposed solution:
The lines that fill in the values on the code: https://github.com/DiemenDesign/summernote-image-attributes/blob/master/summernote-image-attributes.js#L298-L303 should have .val('')
instead of .val()
Pending to get some feedback from the authors of the plugin