Skip to content

Commit

Permalink
IE is special.... so use jQuery to insert the image instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Aug 28, 2010
1 parent 51fdbe1 commit fc8a54f
Showing 1 changed file with 19 additions and 6 deletions.
Expand Up @@ -1728,13 +1728,26 @@ WYMeditor.INIT_DIALOG = function(wym, selected, isIframe) {
$(wym._options.dialogImageSelector).find(wym._options.submitSelector).click(function(e) {
form = $(this.form);
if ((url = form.find(wym._options.srcSelector).val()) != null && url.length > 0) {
wym._exec(WYMeditor.INSERT_IMAGE, wym._current_unique_stamp, selected);
if (!$.browser.msie) {
wym._exec(WYMeditor.INSERT_IMAGE, selected);

if((image = $(wym._doc.body).find("img[src*=" + wym._current_unique_stamp + "]")).length > 0) {
image.attr(WYMeditor.SRC, url)
.attr(WYMeditor.TITLE, form.find(wym._options.titleSelector).val())
.attr(WYMeditor.ALT, form.find(wym._options.titleSelector).val())
.attr(WYMeditor.REL, form.find(wym._options.sizeSelector).val());
if((image = $(wym._doc.body).find("img[src*=" + wym._current_unique_stamp + "]")).length > 0) {
image.attr(WYMeditor.SRC, url)
.attr(WYMeditor.TITLE, form.find(wym._options.titleSelector).val())
.attr(WYMeditor.ALT, form.find(wym._options.titleSelector).val())
.attr(WYMeditor.REL, form.find(wym._options.sizeSelector).val());

if (!$.browser.webkit && replaceable != null && (this._selected_image == null || (this._selected_image != null && replaceable.parentNode != null)))
{
replaceable.after(image).remove();
}
}
} else {
(image = $('<img />'))
.attr(WYMeditor.SRC, url)
.attr(WYMeditor.TITLE, form.find(wym._options.titleSelector).val())
.attr(WYMeditor.ALT, form.find(wym._options.titleSelector).val())
.attr(WYMeditor.REL, form.find(wym._options.sizeSelector).val());

if (!$.browser.webkit && replaceable != null && (this._selected_image == null || (this._selected_image != null && replaceable.parentNode != null)))
{
Expand Down

0 comments on commit fc8a54f

Please sign in to comment.