Ticket #6835: 6835_ref.patch

File 6835_ref.patch, 2.8 KB (added by Garry Yao, 13 years ago)

Patch enables vertical stretch in dialog

  • _source/plugins/dialog/plugin.js

     
    942942                                                        children : contents.elements,
    943943                                                        expand : !!contents.expand,
    944944                                                        padding : contents.padding,
    945                                                         style : contents.style || 'width: 100%;'
     945                                                        style : contents.style || 'width: 100%;height:100%'
    946946                                                }, pageHtml );
    947947
    948948                        // Create the HTML for the tab and the content block.
     
    22552255                                var children = this._.children = childObjList,
    22562256                                        widths = elementDefinition && elementDefinition.widths || null,
    22572257                                        height = elementDefinition && elementDefinition.height || null,
    2258                                         styles = {},
     2258                                        styles = { height: '100%' },
    22592259                                        i;
    22602260                                /** @ignore */
    22612261                                var innerHTML = function()
     
    23402340
    23412341                                var children = this._.children = childObjList,
    23422342                                        width = elementDefinition && elementDefinition.width || null,
    2343                                         heights = elementDefinition && elementDefinition.heights || null;
     2343                                        heights = elementDefinition && elementDefinition.heights || null,
     2344                                        attributes = { cellspacing : 0, border : 0, role : 'presentation', align : CKEDITOR.tools.htmlEncode(
     2345                                                ( elementDefinition && elementDefinition.align ) || ( dialog.getParentEditor().lang.dir == 'ltr' ? 'left' : 'right' ) ) },
     2346                                        styles = { width : cssLength( width || '100%' ), height : ( elementDefinition && elementDefinition.expand !== false ) ? '100%' : '' };
     2347
    23442348                                /** @ignore */
    23452349                                var innerHTML = function()
    23462350                                {
    2347                                         var html = [ '<table role="presentation" cellspacing="0" border="0" ' ];
    2348                                         html.push( 'style="' );
    2349                                         if ( elementDefinition && elementDefinition.expand )
    2350                                                 html.push( 'height:100%;' );
    2351                                         html.push( 'width:' + cssLength( width || '100%' ), ';' );
    2352                                         html.push( '"' );
    2353                                         html.push( 'align="', CKEDITOR.tools.htmlEncode(
    2354                                                 ( elementDefinition && elementDefinition.align ) || ( dialog.getParentEditor().lang.dir == 'ltr' ? 'left' : 'right' ) ), '" ' );
    2355 
    2356                                         html.push( '><tbody>' );
     2351                                        var html = [ '<tbody>' ];
    23572352                                        for ( var i = 0 ; i < childHtmlList.length ; i++ )
    23582353                                        {
    23592354                                                var styles = [];
     
    23702365                                                        html.push( 'style="', styles.join( '; ' ), '" ' );
    23712366                                                html.push( ' class="cke_dialog_ui_vbox_child">', childHtmlList[i], '</td></tr>' );
    23722367                                        }
    2373                                         html.push( '</tbody></table>' );
     2368                                        html.push( '</tbody>' );
    23742369                                        return html.join( '' );
    23752370                                };
    2376                                 CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition || { type : 'vbox' }, htmlList, 'div', null, { role : 'presentation' }, innerHTML );
     2371                                CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition || { type : 'vbox' }, htmlList, 'table', styles, attributes, innerHTML );
    23772372                        }
    23782373                };
    23792374        })();
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy