JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.1
[ckeditor.git] / _source / themes / default / theme.js
index b1e94ba..f7ff8e4 100644 (file)
@@ -10,6 +10,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
 CKEDITOR.themes.add( 'default', (function()\r
 {\r
+       var hiddenSkins = {};\r
+\r
        function checkSharedSpace( editor, spaceName )\r
        {\r
                var container,\r
@@ -121,6 +123,12 @@ CKEDITOR.themes.add( 'default', (function()
                        sharedTop               && ( sharedTop.setHtml( topHtml )               , topHtml = '' );\r
                        sharedBottoms   && ( sharedBottoms.setHtml( bottomHtml ), bottomHtml = '' );\r
 \r
+                       var hideSkin = '<style>.' + editor.skinClass + '{visibility:hidden;}</style>';\r
+                       if ( hiddenSkins[ editor.skinClass ] )\r
+                               hideSkin = '';\r
+                       else\r
+                               hiddenSkins[ editor.skinClass ] = 1;\r
+\r
                        var container = CKEDITOR.dom.element.createFromHtml( [\r
                                '<span' +\r
                                        ' id="cke_', name, '"' +\r
@@ -142,7 +150,7 @@ CKEDITOR.themes.add( 'default', (function()
                                                                '<tr', bottomHtml       ? '' : ' style="display:none"', ' role="presentation"><td id="cke_bottom_'      , name, '" class="cke_bottom" role="presentation">'     , bottomHtml    , '</td></tr>' +\r
                                                        '</tbody></table>' +\r
                                                        //Hide the container when loading skins, later restored by skin css.\r
-                                                       '<style>.', editor.skinClass, '{visibility:hidden;}</style>' +\r
+                                                       hideSkin +\r
                                                '</span>' +\r
                                        '</span>' +\r
                                '</span>' ].join( '' ) );\r
@@ -344,12 +352,13 @@ CKEDITOR.editor.prototype.resize = function( width, height, isContentHeight, res
  * Gets the element that can be freely used to check the editor size. This method\r
  * is mainly used by the resize plugin, which adds a UI handle that can be used\r
  * to resize the editor.\r
+ * @param {Boolean} forContents Whether to return the "contents" part of the theme instead of the container.\r
  * @returns {CKEDITOR.dom.element} The resizable element.\r
  * @example\r
  */\r
-CKEDITOR.editor.prototype.getResizable = function()\r
+CKEDITOR.editor.prototype.getResizable = function( forContents )\r
 {\r
-       return this.container;\r
+       return forContents ? CKEDITOR.document.getById( 'cke_contents_' + this.name ) : this.container;\r
 };\r
 \r
 /**\r