Ticket #121 (closed defect: fixed)
Classes won't apply to images in certain situations
Reported by: | visual77 | Owned by: | jf.hovinne |
---|---|---|---|
Priority: | minor | Milestone: | 0.5 |
Component: | editor | Version: | trunk |
Keywords: | Cc: |
Description
I am attempting to place images into a textarea and then apply a custom class to float left or float right. While doing this, I noticed that the classes would stop applying when certain things were done.
Here are the steps that I followed to create the problem, using both methods that caused it
Method 1:
- Open WYMEditor and type a paragraph of text.
- Click Edit HTML.
- At the beginning of the paragraph, right after the <p> tag, add in an <img /> tag with src as the only attribute.
- Close Edit HTML
- Click the image
- Click the custom class
Method 2:
- Open WYMEditor and type a paragraph of text.
- Click Insert Image and type in all three values for an image that is on the same domain as WYMEditor, so the path would be "/images/image.jpg", rather than " http://domain.com/images/image.jpg"
- Click the image.
- Use Ctrl+X and Ctrl+V to move the image to any spot in the editor.
- Click the image.
- Click the custom class.
In method 2, I also noticed that the URL would change drastically. "/images/image.jpg" would become "../../../images/image.jpg".
The only method that reliably implemented the class was this:
- Open WYMEditor and type a paragraph of text.
- Click Insert Image and fill in the values.
- Click the image
- Click the custom class
It only appeared to break if I moved the image before putting the class or if I added the image manually through HTML.
I've attached the custom CSS file I am using for this.
Attachments
Change History
comment:1 Changed 4 years ago by jf.hovinne
- Status changed from new to assigned
It happens because the click event listener is applied on images at their insertion, using the standard image dialog.
Method 1 bug will easily be fixed by calling listen() (the function which e.g. applies the listeners on images) when the user closes the HTML view.
Method 2 bug needs more work/testing, as browsers don't have the same UI behaviour - so the code will be browser specific.
Note: the image path issue isn't related, see AbsoluteURLs.
this CSS file that i was including in WYMEditor