Ticket #4459: 4459_3.patch
File 4459_3.patch, 2.9 KB (added by , 13 years ago) |
---|
-
_source/plugins/maximize/plugin.js
78 78 restoreFormStyles( data ); 79 79 } 80 80 81 function getResizeHandler( mainWindow, editor )82 {83 return function()84 {85 var viewPaneSize = mainWindow.getViewPaneSize();86 editor.resize( viewPaneSize.width, viewPaneSize.height, null, true );87 };88 }89 90 81 function refreshCursor( editor ) 91 82 { 92 83 if ( editor.focusManager.hasFocus ) … … 103 94 } 104 95 } 105 96 97 /** 98 * Adding an iframe shim to this element, OR removing the existing one if already applied. 99 * Note: This will only affect IE version below 7. 100 */ 101 function createIframeShim( element ) 102 { 103 if ( !CKEDITOR.env.ie || CKEDITOR.env.version > 6 ) 104 return; 105 106 var shim = CKEDITOR.dom.element.createFromHtml( '<iframe frameborder="0" tabindex="-1"' + 107 ' src="javascript:' + 108 'void((function(){' + 109 'document.open();' + 110 ( CKEDITOR.env.isCustomDomain() ? 'document.domain=\'' + this.getDocument().$.domain + '\';' : '' ) + 111 'document.close();' + 112 '})())"' + 113 ' style="display:block;position:absolute;z-index:-1;' + 114 'progid:DXImageTransform.Microsoft.Alpha(opacity=0);' + 115 '"></iframe>' ); 116 return element.append( shim, true ); 117 } 118 106 119 CKEDITOR.plugins.add( 'maximize', 107 120 { 108 121 init : function( editor ) … … 118 131 // Saved scroll position for the outer window. 119 132 var outerScroll; 120 133 134 var shim; 135 121 136 // Saved resize handler function. 122 var resizeHandler = getResizeHandler( mainWindow, editor ); 137 function resizeHandler() 138 { 139 var viewPaneSize = mainWindow.getViewPaneSize(); 140 shim && shim.setStyles( { width : viewPaneSize.width + 'px', height : viewPaneSize.height + 'px' } ); 141 editor.resize( viewPaneSize.width, viewPaneSize.height, null, true ); 142 }; 123 143 124 144 // Retain state after mode switches. 125 145 var savedState = CKEDITOR.TRISTATE_OFF; … … 196 216 left : '0px', 197 217 top : '0px' 198 218 } ); 199 editor.resize( viewPaneSize.width, viewPaneSize.height, null, true );200 219 220 shim = createIframeShim( container ); // IE6 select element penetration when maximized. (#4459) 221 resizeHandler(); 222 201 223 // Still not top left? Fix it. (Bug #174) 202 224 var offset = container.getDocumentPosition(); 203 225 container.setStyles( … … 240 262 // Remove cke_maximized class. 241 263 container.removeClass( 'cke_maximized' ); 242 264 265 if ( shim ) 266 { 267 shim.remove(); 268 shim = null; 269 } 270 243 271 // Emit a resize event, because this time the size is modified in 244 272 // restoreStyles. 245 273 editor.fire( 'resize' );