Ticket #6376: 6376_2.patch
File 6376_2.patch, 2.0 KB (added by , 14 years ago) |
---|
-
_source/plugins/bidi/plugin.js
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 dirBefore = element.getComputedStyle( 'direction' ); 58 59 element.removeStyle( 'direction' ); 60 element.removeAttribute( 'dir' ); 57 var useComputedState = editor.config.useComputedState; 58 useComputedState = useComputedState === undefined || useComputedState; 59 60 var elementDir = useComputedState ? element.getComputedStyle( 'direction' ) 61 : element.hasAttribute( 'dir' ) || element.getStyle( 'direction' ); 61 62 62 if ( state == CKEDITOR.TRISTATE_OFF && element.getComputedStyle( 'direction' ).toLowerCase() != dir ) 63 element.setAttribute( 'dir', dir ); 63 // Stop if direction is same as present. 64 if ( elementDir == dir ) 65 return; 66 67 var dirBefore = element.getComputedStyle( 'direction' ); 68 69 element.setAttribute( 'dir', dir ); 64 70 65 71 // If the element direction changed, we need to switch the margins of 66 72 // the element and all its children, so it will get really reflected … … 98 104 } 99 105 100 106 editor.forceNextSelectionCheck(); 107 108 return null; 101 109 } 102 110 103 111 function getFullySelected( selection, elements ) … … 136 144 if ( selectedElement ) 137 145 { 138 146 if ( !selectedElement.isReadOnly() ) 139 switchDir( selectedElement, dir, editor , this.state);147 switchDir( selectedElement, dir, editor ); 140 148 } 141 149 else 142 150 { … … 163 171 164 172 while ( ( block = walker.next() ) ) 165 173 { 166 switchDir( block, dir, editor , this.state);174 switchDir( block, dir, editor ); 167 175 processedElements.push( block ); 168 176 } 169 177 … … 199 207 200 208 if ( !_break ) 201 209 { 202 switchDir( block, dir, editor , this.state);210 switchDir( block, dir, editor ); 203 211 } 204 212 } 205 213 }