if ( !formElement || formElement.type != CKEDITOR.NODE_ELEMENT || formElement.getName() != 'form' )\r
return [];\r
\r
- var hijackRecord = [];\r
- var hijackNames = [ 'style', 'className' ];\r
+ var hijackRecord = [],\r
+ hijackNames = [ 'style', 'className' ];\r
for ( var i = 0 ; i < hijackNames.length ; i++ )\r
{\r
var name = hijackNames[i];\r
\r
function refreshCursor( editor )\r
{\r
+ // Refresh all editor instances on the page (#5724).\r
+ var all = CKEDITOR.instances;\r
+ for ( var i in all )\r
+ {\r
+ var one = all[ i ];\r
+ if ( one.mode == 'wysiwyg' )\r
+ {\r
+ var body = one.document.getBody();\r
+ // Refresh 'contentEditable' otherwise\r
+ // DOM lifting breaks design mode. (#5560)\r
+ body.setAttribute( 'contentEditable', false );\r
+ body.setAttribute( 'contentEditable', true );\r
+ }\r
+ }\r
+\r
if ( editor.focusManager.hasFocus )\r
{\r
editor.toolbox.focus();\r
init : function( editor )\r
{\r
var lang = editor.lang;\r
- var mainDocument = CKEDITOR.document;\r
- var mainWindow = mainDocument.getWindow();\r
+ var mainDocument = CKEDITOR.document,\r
+ mainWindow = mainDocument.getWindow();\r
\r
// Saved selection and scroll position for the editing area.\r
- var savedSelection;\r
- var savedScroll;\r
+ var savedSelection,\r
+ savedScroll;\r
\r
// Saved scroll position for the outer window.\r
var outerScroll;\r
container.setCustomData( 'maximize_saved_styles', saveStyles( container, true ) );\r
\r
// Hide scroll bars.\r
- if ( CKEDITOR.env.ie )\r
- {\r
- mainDocument.$.documentElement.style.overflow =\r
- mainDocument.getBody().$.style.overflow = 'hidden';\r
- }\r
- else\r
- {\r
- mainDocument.getBody().setStyles(\r
- {\r
- overflow : 'hidden',\r
- width : '0px',\r
- height : '0px'\r
- } );\r
- }\r
+ var viewPaneSize = mainWindow.getViewPaneSize();\r
+ var styles =\r
+ {\r
+ overflow : 'hidden',\r
+ width : 0,\r
+ height : 0\r
+ };\r
+\r
+ mainDocument.getDocumentElement().setStyles( styles );\r
+ !CKEDITOR.env.gecko && mainDocument.getDocumentElement().setStyle( 'position', 'fixed' );\r
+ mainDocument.getBody().setStyles( styles );\r
\r
// Scroll to the top left (IE needs some time for it - #4923).\r
CKEDITOR.env.ie ?\r
mainWindow.$.scrollTo( 0, 0 );\r
\r
// Resize and move to top left.\r
- var viewPaneSize = mainWindow.getViewPaneSize();\r
container.setStyle( 'position', 'absolute' );\r
container.$.offsetLeft; // SAFARI BUG: See #2066.\r
container.setStyles(\r
} );\r
\r
shim = createIframeShim( container ); // IE6 select element penetration when maximized. (#4459)\r
+\r
+ // Add cke_maximized class before resize handle since that will change things sizes (#5580)\r
+ container.addClass( 'cke_maximized' );\r
+\r
resizeHandler();\r
\r
// Still not top left? Fix it. (Bug #174)\r
// Fixing positioning editor chrome in Firefox break design mode. (#5149)\r
CKEDITOR.env.gecko && refreshCursor( editor );\r
\r
- // Add cke_maximized class.\r
- container.addClass( 'cke_maximized' );\r
}\r
else if ( this.state == CKEDITOR.TRISTATE_ON ) // Restore from fullscreen if the state is on.\r
{\r
command : 'maximize'\r
} );\r
\r
- // Restore the command state after mode change.\r
+ // Restore the command state after mode change, unless it has been changed to disabled (#6467)\r
editor.on( 'mode', function()\r
{\r
- editor.getCommand( 'maximize' ).setState( savedState );\r
+ var command = editor.getCommand( 'maximize' );\r
+ command.setState( command.state == CKEDITOR.TRISTATE_DISABLED ? CKEDITOR.TRISTATE_DISABLED : savedState );\r
}, null, null, 100 );\r
}\r
} );\r