STEP ONE:
I had to add a bit of code for when the iframe is finished loading. Ex:
// if we are inside our iframe...
$(document).ready(function() { parent.nudgeiFrame(); });
This calls a function on the PARENT page that is loading the dialog, not from within the iframe itself!
SOLUTION #1 (less elegant)
It would "nudge" the entire dialog by one pixel, after a brief delay. This worked extremely well, but it has the downside of making your dialog slowly move down the screen if they keep reloading it. Most users probably would never notice it, so I kept this option for a while:
function nudgeiFrame() {
setTimeout(function() {
$("div[role=dialog]").each(function() {
$(this).addClass('ui-draggable-dragging');
$(this).addClass('ui-dialog-dragging');
var y = $(this).css('top');
var oldy = y;
y = parseFloat(y.replace("px", ""));
var newy = (y + 1) + "px";
$(this).css('top', newy);
});
}, 75);
}
SOLUTION #2 (More elegant)
I discovered (through HOURS of testing) that all I really needed to do was to add content to the dialog (not the iframe).
I decided to add a simple so that it wouldn't cause the dialog to resize or anything like that. Believe it or not, this works and doesn't cause any ill-effects that I can see.
function nudgeiFrame() {
setTimeout(function() {
$("div[role=dialog]").each(function() {
$(this).append("<span></span>");
});
}, 75);
}
I hope this helps someone out there. Took me such a long time to figure out.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…