Ticket #8453 (closed bug: notabug)
opening jqueryui dialog messes up content in iframe within dialog
|Reported by:||jslaybaugh||Owned by:||jslaybaugh|
I'm using wysihtml5 for rich text editing and it works great, except in my jquery ui dialogs. When that happens, for some reason, jqueryUI seems to be stripping out the <link rel="" type="" href=""> tags from the head of the iframe that wysihtml5 creates on the fly. To make it work, on dialog:open, I end up having to do something like this:
var iframedoc = $(event.target).find("iframe").get(0).contentDocument;
$(iframedoc).find("head").html("<link rel='stylesheet' type='text/css' href='/Content/css/wysihtml5-content.css'>");
So that I can add the appropriate styles back in. I tried stepping through the code to see if I saw anything specific where it was stripping this content specifically (because it leaves most of the other inline <style></style> content as well as all the body html, but it just removes a <meta> tag and any <link> tags from the head.
I tried to also create a jsfiddle but it seems jqueryui dialog doesnt work in jsfiddle anyway.
I'm using jquery 1.7.1, jqueryui 1.8.16, and wysihtml5 0.3.0 rc2.
Thanks - Jorin