Ticket #6614: 6614_3.patch

File 6614_3.patch, 8.5 KB (added by Garry Yao, 13 years ago)
  • _source/skins/v2/mainui.css

     
    110110        cursor: move;
    111111}
    112112
    113 .cke_skin_v2 .cke_rtl .cke_resizer
     113.cke_skin_v2 .cke_resizer_rtl
    114114{
    115115        cursor: sw-resize;
    116116        /* resizer_rtl.gif*/
  • _source/plugins/dialog/plugin.js

     
    167167
    168168                // Set the startup styles for the dialog, avoiding it enlarging the
    169169                // page size on the dialog creation.
    170                 this.parts.dialog.setStyles(
    171                         {
     170                var startStyles = {
    172171                                position : CKEDITOR.env.ie6Compat ? 'absolute' : 'fixed',
    173172                                top : 0,
    174                                 left: 0,
    175173                                visibility : 'hidden'
    176                         });
     174                };
    177175
     176                startStyles[ dir == 'rtl' ? 'right' : 'left' ] = 0;
     177                this.parts.dialog.setStyles( startStyles );
     178
     179
    178180                // Call the CKEDITOR.event constructor to initialize this instance.
    179181                CKEDITOR.event.call( this );
    180182
     
    635637                                                height : height
    636638                                        }, this._.editor );
    637639
     640                                // Update dialog position when dimension get changed in RTL.
     641                                if ( this._.editor.lang.dir == 'rtl' && this._.position )
     642                                        this._.position.x = CKEDITOR.document.getWindow().getViewPaneSize().width -
     643                                                this._.contentSize.width - parseInt( this._.element.getFirst().getStyle( 'right' ) );
     644
    638645                                this._.contentSize = { width : width, height : height };
    639646                        };
    640647                })(),
     
    667674                        {
    668675                                // The dialog may be fixed positioned or absolute positioned. Ask the
    669676                                // browser what is the current situation first.
    670                                 var element = this._.element.getFirst();
     677                                var element = this._.element.getFirst(),
     678                                        rtl = this._.editor.lang.dir == 'rtl';
     679
    671680                                if ( isFixed === undefined )
    672681                                        isFixed = element.getComputedStyle( 'position' ) == 'fixed';
    673682
     
    685694                                        y += scrollPosition.y;
    686695                                }
    687696
    688                                 element.setStyles(
    689                                                 {
    690                                                         'left'  : ( x > 0 ? x : 0 ) + 'px',
    691                                                         'top'   : ( y > 0 ? y : 0 ) + 'px'
    692                                                 });
     697                                // Translate coordinate for RTL.
     698                                if ( rtl )
     699                                {
     700                                        var dialogSize = this.getSize(),
     701                                                viewPaneSize = CKEDITOR.document.getWindow().getViewPaneSize();
     702                                        x = viewPaneSize.width - dialogSize.width - x;
     703                                }
    693704
     705                                var styles = { 'top'    : ( y > 0 ? y : 0 ) + 'px' };
     706                                styles[ rtl ? 'right' : 'left' ] = ( x > 0 ? x : 0 ) + 'px';
     707
     708                                element.setStyles( styles );
     709
    694710                                save && ( this._.moved = 1 );
    695711                        };
    696712                })(),
     
    17031719                                viewSize, origin, startSize,
    17041720                                dialogCover;
    17051721
    1706                 function positionDialog( right )
    1707                 {
    1708                         // Maintain righthand sizing in RTL.
    1709                         if ( dialog._.moved && editor.lang.dir == 'rtl' )
    1710                         {
    1711                                 var element = dialog._.element.getFirst();
    1712                                 element.setStyle( 'right', right + "px" );
    1713                                 element.removeStyle( 'left' );
    1714                         }
    1715                         else if ( !dialog._.moved )
    1716                                 dialog.layout();
    1717                 }
    1718 
    17191722                var mouseDownFn = CKEDITOR.tools.addFunction( function( $event )
    17201723                {
    17211724                        startSize = dialog.getSize();
     
    17591762                                direction = ' cke_resizer_horizontal';
    17601763                        else if ( resizable == CKEDITOR.DIALOG_RESIZE_HEIGHT )
    17611764                                direction = ' cke_resizer_vertical';
    1762                         var resizer = CKEDITOR.dom.element.createFromHtml( '<div class="cke_resizer' + direction + '"' +
     1765                        var resizer = CKEDITOR.dom.element.createFromHtml( '<div' +
     1766                                        ' class="cke_resizer' + direction + ' cke_resizer_' + editor.lang.dir + '"' +
    17631767                                        ' title="' + CKEDITOR.tools.htmlEncode( editor.lang.resize ) + '"' +
    17641768                                        ' onmousedown="CKEDITOR.tools.callFunction(' + mouseDownFn + ', event )"></div>' );
    17651769                        dialog.parts.footer.append( resizer, 1 );
     
    17791783                                right = rtl && element.getComputedStyle( 'right' ),
    17801784                                position = dialog.getPosition();
    17811785
    1782                         // IE might return "auto", we need exact position.
    1783                         if ( right )
    1784                                 right = right == 'auto' ? viewSize.width - ( position.x || 0 ) - element.getSize( 'width' ) : parseInt( right, 10 );
    1785 
    17861786                        if ( position.y + internalHeight > viewSize.height )
    17871787                                internalHeight = viewSize.height - position.y;
    17881788
     
    17901790                                internalWidth = viewSize.width - ( rtl ? right : position.x );
    17911791
    17921792                        // Make sure the dialog will not be resized to the wrong side when it's in the leftmost position for RTL.
    1793                         if ( ( resizable == CKEDITOR.DIALOG_RESIZE_WIDTH || resizable == CKEDITOR.DIALOG_RESIZE_BOTH ) && !( rtl && dx > 0 && !position.x ) )
     1793                        if ( ( resizable == CKEDITOR.DIALOG_RESIZE_WIDTH || resizable == CKEDITOR.DIALOG_RESIZE_BOTH ) )
    17941794                                width = Math.max( def.minWidth || 0, internalWidth - wrapperWidth );
    17951795
    17961796                        if ( resizable == CKEDITOR.DIALOG_RESIZE_HEIGHT || resizable == CKEDITOR.DIALOG_RESIZE_BOTH )
    17971797                                height = Math.max( def.minHeight || 0, internalHeight - wrapperHeight );
    17981798
    17991799                        dialog.resize( width, height );
    1800                         // The right property might get broken during resizing, so computing it before the resizing.
    1801                         positionDialog( right );
    18021800
     1801                        if ( !dialog._.moved )
     1802                                dialog.layout();
     1803
    18031804                        evt.data.preventDefault();
    18041805                }
    18051806
     
    18201821                                coverDoc.removeListener( 'mouseup', mouseUpHandler );
    18211822                                coverDoc.removeListener( 'mousemove', mouseMoveHandler );
    18221823                        }
    1823 
    1824                         // Switch back to use the left property, if RTL is used.
    1825                         if ( editor.lang.dir == 'rtl' )
    1826                         {
    1827                                 var element = dialog._.element.getFirst(),
    1828                                         left = element.getComputedStyle( 'left' );
    1829 
    1830                                 // IE might return "auto", we need exact position.
    1831                                 if ( left == 'auto' )
    1832                                         left = viewSize.width - parseInt( element.getStyle( 'right' ), 10 ) - dialog.getSize().width;
    1833                                 else
    1834                                         left = parseInt( left, 10 );
    1835 
    1836                                 element.removeStyle( 'right' );
    1837                                 // Make sure the left property gets applied, even if it is the same as previously.
    1838                                 dialog._.position.x += 1;
    1839                                 dialog.move( left, dialog._.position.y );
    1840                         }
    1841                 }
    1842         }
     1824                }
     1825        }
    18431826
    18441827        var resizeCover;
    18451828        // Caching resuable covers and allowing only one cover
  • _source/plugins/resize/plugin.js

     
    99        {
    1010                var config = editor.config;
    1111
     12                // Resize in the same direction of chrome,
     13                // which is identical to dir of editor element. (#6614)
     14                var resizeDir = editor.element.getDirection( 1 );
     15
    1216                !config.resize_dir && ( config.resize_dir = 'both' );
    1317                ( config.resize_maxWidth == undefined ) && ( config.resize_maxWidth = 3000 );
    1418                ( config.resize_maxHeight == undefined ) && ( config.resize_maxHeight = 3000 );
     
    3135                                        dy = evt.data.$.screenY - origin.y,
    3236                                        width = startSize.width,
    3337                                        height = startSize.height,
    34                                         internalWidth = width + dx * ( editor.lang.dir == 'rtl' ? -1 : 1 ),
     38                                        internalWidth = width + dx * ( resizeDir == 'rtl' ? -1 : 1 ),
    3539                                        internalHeight = height + dy;
    3640
    3741                                if ( resizeHorizontal )
     
    8892                                                if ( !resizeHorizontal && resizeVertical )
    8993                                                        direction = ' cke_resizer_vertical';
    9094
    91                                                 event.data.html += '<div class="cke_resizer' + direction + '"' +
     95                                                var resizerHtml =
     96                                                        '<div' +
     97                                                        ' class="cke_resizer' + direction + ' cke_resizer_' + resizeDir + '"' +
    9298                                                        ' title="' + CKEDITOR.tools.htmlEncode( editor.lang.resize ) + '"' +
    9399                                                        ' onmousedown="CKEDITOR.tools.callFunction(' + mouseDownFn + ', event)"' +
    94100                                                        '></div>';
     101
     102                                                // Always sticks the corner of botttom space.
     103                                                resizeDir == 'ltr' && direction == 'ltr' ?
     104                                                        event.data.html += resizerHtml :
     105                                                        event.data.html = resizerHtml + event.data.html;
    95106                                        }
    96107                                }, editor, null, 100 );
    97108                }
  • _source/skins/office2003/mainui.css

     
    101101        cursor: move;
    102102}
    103103
    104 .cke_skin_office2003 .cke_rtl .cke_resizer
     104.cke_skin_office2003 .cke_resizer_rtl
    105105{
    106106        cursor: sw-resize;
    107107        /* resizer_rtl.gif*/
  • _source/skins/kama/mainui.css

     
    133133        cursor: move;
    134134}
    135135
    136 .cke_skin_kama .cke_rtl .cke_resizer
     136.cke_skin_kama .cke_resizer_rtl
    137137{
    138138        cursor: sw-resize;
    139139        /* resizer_rtl.gif*/
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy