Ticket #6376: 6376_3.patch
File 6376_3.patch, 2.2 KB (added by , 14 years ago) |
---|
-
_source/plugins/bidi/plugin.js
1 /*1 /* 2 2 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. 3 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 4 */ … … 52 52 chromeRoot.removeClass( 'cke_mixed_dir_content' ); 53 53 } 54 54 55 function switchDir( element, dir, editor , state)55 function switchDir( element, dir, editor ) 56 56 { 57 var useComputedState = editor.config.useComputedState; 58 useComputedState = useComputedState === undefined || useComputedState; 59 60 var elementDir = useComputedState ? element.getComputedStyle( 'direction' ) 61 : element.getStyle( 'direction' ) || element.hasAttribute( 'dir' ); 62 63 // Stop if direction is same as present. 64 if ( elementDir == dir ) 65 return; 66 57 67 var dirBefore = element.getComputedStyle( 'direction' ); 58 68 59 element.removeStyle( 'direction' );60 69 element.removeAttribute( 'dir' ); 70 element.setStyle( 'direction', dir ); 61 71 62 if ( state == CKEDITOR.TRISTATE_OFF && element.getComputedStyle( 'direction' ).toLowerCase() != dir )63 element.setAttribute( 'dir', dir );64 65 72 // If the element direction changed, we need to switch the margins of 66 73 // the element and all its children, so it will get really reflected 67 74 // like a mirror. (#5910) … … 70 77 editor.fire( 'dirChanged', element ); 71 78 72 79 editor.forceNextSelectionCheck(); 80 81 return null; 73 82 } 74 83 75 84 function getFullySelected( selection, elements ) … … 108 117 if ( selectedElement ) 109 118 { 110 119 if ( !selectedElement.isReadOnly() ) 111 switchDir( selectedElement, dir, editor , this.state);120 switchDir( selectedElement, dir, editor ); 112 121 } 113 122 else 114 123 { … … 135 144 136 145 while ( ( block = walker.next() ) ) 137 146 { 138 switchDir( block, dir, editor , this.state);147 switchDir( block, dir, editor ); 139 148 processedElements.push( block ); 140 149 } 141 150 … … 171 180 172 181 if ( !_break ) 173 182 { 174 switchDir( block, dir, editor , this.state);183 switchDir( block, dir, editor ); 175 184 } 176 185 } 177 186 }