X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fjustify%2Fplugin.js;h=036434ddd4e8d6535c5056e047f81c78d3a74e02;hp=8d306b995aaa12acf78b827d1a07ccb6bf8e5840;hb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7;hpb=9873d66421922c7aef8be0f5d2ab51e547b19e66 diff --git a/_source/plugins/justify/plugin.js b/_source/plugins/justify/plugin.js index 8d306b9..036434d 100644 --- a/_source/plugins/justify/plugin.js +++ b/_source/plugins/justify/plugin.js @@ -25,9 +25,20 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { useComputedState = useComputedState === undefined || useComputedState; - var align = useComputedState ? - element.getComputedStyle( 'text-align' ) : - element.getStyle( 'text-align' ) || element.getAttribute( 'align' ) || ''; + var align; + if ( useComputedState ) + align = element.getComputedStyle( 'text-align' ); + else + { + while ( !element.hasAttribute || !( element.hasAttribute( 'align' ) || element.getStyle( 'text-align' ) ) ) + { + var parent = element.getParent(); + if ( !parent ) + break; + element = parent; + } + align = element.getStyle( 'text-align' ) || element.getAttribute( 'align' ) || ''; + } align && ( align = align.replace( /-moz-|-webkit-|start|auto/i, '' ) );