| | 359 | // If there are several images, and you try to link each one, all the images get inside the link: |
| | 360 | // <img><img> -> <a><img></a><img> -> <a><img><img></a> due to the call to 'CreateLink' (bug in IE) |
| | 361 | if (FCKSelection.GetType() == 'Control') |
| | 362 | { |
| | 363 | // Create a link |
| | 364 | var oLink = this.EditorDocument.createElement( 'A' ) ; |
| | 365 | oLink.href = url ; |
| | 366 | |
| | 367 | // Get the selected object |
| | 368 | var oControl = FCKSelection.GetSelectedElement() ; |
| | 369 | // Put the link just before the object |
| | 370 | oControl.parentNode.insertBefore(oLink, oControl) ; |
| | 371 | // Move the object inside the link |
| | 372 | oControl.parentNode.removeChild( oControl ) ; |
| | 373 | oLink.appendChild( oControl ) ; |
| | 374 | |
| | 375 | return oLink ; |
| | 376 | } |
| | 377 | |