Ticket #6614: 6614_3.patch
File 6614_3.patch, 8.5 KB (added by , 13 years ago) |
---|
-
_source/skins/v2/mainui.css
110 110 cursor: move; 111 111 } 112 112 113 .cke_skin_v2 .cke_r tl .cke_resizer113 .cke_skin_v2 .cke_resizer_rtl 114 114 { 115 115 cursor: sw-resize; 116 116 /* resizer_rtl.gif*/ -
_source/plugins/dialog/plugin.js
167 167 168 168 // Set the startup styles for the dialog, avoiding it enlarging the 169 169 // page size on the dialog creation. 170 this.parts.dialog.setStyles( 171 { 170 var startStyles = { 172 171 position : CKEDITOR.env.ie6Compat ? 'absolute' : 'fixed', 173 172 top : 0, 174 left: 0,175 173 visibility : 'hidden' 176 });174 }; 177 175 176 startStyles[ dir == 'rtl' ? 'right' : 'left' ] = 0; 177 this.parts.dialog.setStyles( startStyles ); 178 179 178 180 // Call the CKEDITOR.event constructor to initialize this instance. 179 181 CKEDITOR.event.call( this ); 180 182 … … 635 637 height : height 636 638 }, this._.editor ); 637 639 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 638 645 this._.contentSize = { width : width, height : height }; 639 646 }; 640 647 })(), … … 667 674 { 668 675 // The dialog may be fixed positioned or absolute positioned. Ask the 669 676 // 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 671 680 if ( isFixed === undefined ) 672 681 isFixed = element.getComputedStyle( 'position' ) == 'fixed'; 673 682 … … 685 694 y += scrollPosition.y; 686 695 } 687 696 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 } 693 704 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 694 710 save && ( this._.moved = 1 ); 695 711 }; 696 712 })(), … … 1703 1719 viewSize, origin, startSize, 1704 1720 dialogCover; 1705 1721 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 1719 1722 var mouseDownFn = CKEDITOR.tools.addFunction( function( $event ) 1720 1723 { 1721 1724 startSize = dialog.getSize(); … … 1759 1762 direction = ' cke_resizer_horizontal'; 1760 1763 else if ( resizable == CKEDITOR.DIALOG_RESIZE_HEIGHT ) 1761 1764 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 + '"' + 1763 1767 ' title="' + CKEDITOR.tools.htmlEncode( editor.lang.resize ) + '"' + 1764 1768 ' onmousedown="CKEDITOR.tools.callFunction(' + mouseDownFn + ', event )"></div>' ); 1765 1769 dialog.parts.footer.append( resizer, 1 ); … … 1779 1783 right = rtl && element.getComputedStyle( 'right' ), 1780 1784 position = dialog.getPosition(); 1781 1785 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 1786 1786 if ( position.y + internalHeight > viewSize.height ) 1787 1787 internalHeight = viewSize.height - position.y; 1788 1788 … … 1790 1790 internalWidth = viewSize.width - ( rtl ? right : position.x ); 1791 1791 1792 1792 // 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 ) ) 1794 1794 width = Math.max( def.minWidth || 0, internalWidth - wrapperWidth ); 1795 1795 1796 1796 if ( resizable == CKEDITOR.DIALOG_RESIZE_HEIGHT || resizable == CKEDITOR.DIALOG_RESIZE_BOTH ) 1797 1797 height = Math.max( def.minHeight || 0, internalHeight - wrapperHeight ); 1798 1798 1799 1799 dialog.resize( width, height ); 1800 // The right property might get broken during resizing, so computing it before the resizing.1801 positionDialog( right );1802 1800 1801 if ( !dialog._.moved ) 1802 dialog.layout(); 1803 1803 1804 evt.data.preventDefault(); 1804 1805 } 1805 1806 … … 1820 1821 coverDoc.removeListener( 'mouseup', mouseUpHandler ); 1821 1822 coverDoc.removeListener( 'mousemove', mouseMoveHandler ); 1822 1823 } 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 } 1843 1826 1844 1827 var resizeCover; 1845 1828 // Caching resuable covers and allowing only one cover -
_source/plugins/resize/plugin.js
9 9 { 10 10 var config = editor.config; 11 11 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 12 16 !config.resize_dir && ( config.resize_dir = 'both' ); 13 17 ( config.resize_maxWidth == undefined ) && ( config.resize_maxWidth = 3000 ); 14 18 ( config.resize_maxHeight == undefined ) && ( config.resize_maxHeight = 3000 ); … … 31 35 dy = evt.data.$.screenY - origin.y, 32 36 width = startSize.width, 33 37 height = startSize.height, 34 internalWidth = width + dx * ( editor.lang.dir == 'rtl' ? -1 : 1 ),38 internalWidth = width + dx * ( resizeDir == 'rtl' ? -1 : 1 ), 35 39 internalHeight = height + dy; 36 40 37 41 if ( resizeHorizontal ) … … 88 92 if ( !resizeHorizontal && resizeVertical ) 89 93 direction = ' cke_resizer_vertical'; 90 94 91 event.data.html += '<div class="cke_resizer' + direction + '"' + 95 var resizerHtml = 96 '<div' + 97 ' class="cke_resizer' + direction + ' cke_resizer_' + resizeDir + '"' + 92 98 ' title="' + CKEDITOR.tools.htmlEncode( editor.lang.resize ) + '"' + 93 99 ' onmousedown="CKEDITOR.tools.callFunction(' + mouseDownFn + ', event)"' + 94 100 '></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; 95 106 } 96 107 }, editor, null, 100 ); 97 108 } -
_source/skins/office2003/mainui.css
101 101 cursor: move; 102 102 } 103 103 104 .cke_skin_office2003 .cke_r tl .cke_resizer104 .cke_skin_office2003 .cke_resizer_rtl 105 105 { 106 106 cursor: sw-resize; 107 107 /* resizer_rtl.gif*/ -
_source/skins/kama/mainui.css
133 133 cursor: move; 134 134 } 135 135 136 .cke_skin_kama .cke_r tl .cke_resizer136 .cke_skin_kama .cke_resizer_rtl 137 137 { 138 138 cursor: sw-resize; 139 139 /* resizer_rtl.gif*/