Ticket #187 (closed defect: fixed)
Changes to links are not always submitted
Reported by: | pluijm | Owned by: | jf.hovinne |
---|---|---|---|
Priority: | minor | Milestone: | 0.5 |
Component: | editor | Version: | trunk |
Keywords: | Cc: |
Description
When editing a link (A), the changes are not always submitted. I tested this with Firefox 3.0.11 & Opera 9.64
Reproduce:
- Select text in editor, fill in field(s) and hit submit
- Take the focus of the selected text and click on the newly created link (do not select)
- Click on create link button
- Edit link or title
- Hit submit
- Link is not edited
There is no problem if the link is fully selected
Sugested fix:
--- jquery.wymeditor.js (revision 646) +++ jquery.wymeditor.js (working copy) @@ -1473,9 +1473,15 @@ var sUrl = jQuery(wym._options.hrefSelector).val(); if(sUrl.length > 0) { - wym._exec(WYMeditor.CREATE_LINK, sStamp); + var link; + if (selected[0] && selected[0].tagName.toLowerCase() == WYMeditor.A) { + link = selected; + } else { + wym._exec(WYMeditor.CREATE_LINK, sStamp); + link = jQuery("a[href=" + sStamp + "]", wym._doc.body) + } - jQuery("a[href=" + sStamp + "]", wym._doc.body) + link .attr(WYMeditor.HREF, sUrl) .attr(WYMeditor.TITLE, jQuery(wym._options.titleSelector).val());
Change History
Note: See
TracTickets for help on using
tickets.
Suggested fix implemented in r652.