Changeset 5763
- Timestamp:
- 07/28/10 14:44:21 (3 years ago)
- Location:
- CKEditor/branches/versions/3.4.x
- Files:
-
- 2 edited
-
CHANGES.html (modified) (1 diff)
-
_source/plugins/justify/plugin.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/branches/versions/3.4.x/CHANGES.html
r5758 r5763 61 61 <li><a href="http://dev.fckeditor.net/ticket/5689">#5689</a> : Make it possible to run CKEditor inside of Firefox chrome.</li> 62 62 <li><a href="http://dev.fckeditor.net/ticket/5531">#5531</a> : Not all IDs had the "cke_" prefix.</li> 63 <li><a href="http://dev.fckeditor.net/ticket/6042">#6042</a> : It wasn't possible to align a paragarph with the dir attribute to the opposite direction.</li> 63 64 </ul> 64 65 <h3> -
CKEditor/branches/versions/3.4.x/_source/plugins/justify/plugin.js
r5709 r5763 20 20 21 21 var currentAlign = firstBlock.getComputedStyle( 'text-align' ).replace( alignRemoveRegex, '' ); 22 if ( ( !currentAlign && this.isDefaultAlign) || currentAlign == this.value )22 if ( ( !currentAlign && isDefaultAlign( this, firstBlock ) ) || currentAlign == this.value ) 23 23 return CKEDITOR.TRISTATE_ON; 24 24 return CKEDITOR.TRISTATE_OFF; … … 32 32 } 33 33 34 function isDefaultAlign( command, element ) 35 { 36 var direction = element.getComputedStyle( 'direction' ), 37 val = command.value; 38 return ( direction == 'rtl' && val == 'right' ) || ( direction == 'ltr' && val == 'left' ); 39 40 } 41 34 42 function justifyCommand( editor, name, value ) 35 43 { 36 44 this.name = name; 37 45 this.value = value; 38 39 var contentDir = editor.config.contentsLangDirection;40 this.isDefaultAlign = ( value == 'left' && contentDir == 'ltr' ) ||41 ( value == 'right' && contentDir == 'rtl' );42 46 43 47 var classes = editor.config.justifyClasses; … … 89 93 block.removeAttribute( 'align' ); 90 94 95 var isDefault = isDefaultAlign( this, block ); 96 91 97 if ( cssClassName ) 92 98 { … … 96 102 97 103 // Append the desired class name. 98 if ( this.state == CKEDITOR.TRISTATE_OFF && ! this.isDefaultAlign)104 if ( this.state == CKEDITOR.TRISTATE_OFF && !isDefault ) 99 105 block.addClass( cssClassName ); 100 106 else if ( !className ) … … 103 109 else 104 110 { 105 if ( this.state == CKEDITOR.TRISTATE_OFF && ! this.isDefaultAlign)111 if ( this.state == CKEDITOR.TRISTATE_OFF && !isDefault ) 106 112 block.setStyle( 'text-align', this.value ); 107 113 else
Note: See TracChangeset
for help on using the changeset viewer.
