Skip to content

Commit

Permalink
Fix for IE loading preview in QM.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand authored and Reinmar committed Jan 8, 2014
1 parent eee34a6 commit 9380369
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions plugins/preview/plugin.js
Expand Up @@ -61,10 +61,12 @@
if ( !editor.fire( 'contentPreview', eventData = { dataValue: sHTML } ) )
return false;

var sOpenUrl = '';
var sOpenUrl = '',
ieLocation;

if ( CKEDITOR.env.ie ) {
window._cke_htmlToLoad = eventData.dataValue;
sOpenUrl = 'javascript:void( (function(){' +
ieLocation = 'javascript:void( (function(){' +
'document.open();' +
// Support for custom document.domain.
// Strip comments and replace parent with window.opener in the function body.
Expand All @@ -73,6 +75,8 @@
'document.close();' +
'window.opener._cke_htmlToLoad = null;' +
'})() )';
// For IE we should use window.location rather than setting url in window.open. (#11146)
sOpenUrl = '';
}

// With Firefox only, we need to open a special preview page, so
Expand All @@ -85,6 +89,9 @@
var oWindow = window.open( sOpenUrl, null, 'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' +
iWidth + ',height=' + iHeight + ',left=' + iLeft );

if ( CKEDITOR.env.ie )
oWindow.location = ieLocation;

if ( !CKEDITOR.env.ie && !CKEDITOR.env.gecko ) {
var doc = oWindow.document;
doc.open();
Expand Down

0 comments on commit 9380369

Please sign in to comment.