X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fbidi%2Fplugin.js;h=2233ee1881a54d462bbfa7c0ec1b80f2351f8810;hp=44ece03b514b1174f4a38a26356cfc6ad75c65cf;hb=f0610347140239143439a511ee2bd48cb784f470;hpb=4e70ea24db840898be8cc21c950363a52a2a6aba diff --git a/_source/plugins/bidi/plugin.js b/_source/plugins/bidi/plugin.js index 44ece03..2233ee1 100644 --- a/_source/plugins/bidi/plugin.js +++ b/_source/plugins/bidi/plugin.js @@ -38,10 +38,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license selectedElement = selectedElement || path.block || path.blockLimit; // If we're having BODY here, user probably done CTRL+A, let's try to get the enclosed node, if any. - selectedElement.is( 'body' ) && - ( selectedElement = editor.getSelection().getRanges()[ 0 ].getEnclosedNode() ); + if ( selectedElement.is( 'body' ) ) + { + var enclosedNode = editor.getSelection().getRanges()[ 0 ].getEnclosedNode(); + enclosedNode && enclosedNode.type == CKEDITOR.NODE_ELEMENT && ( selectedElement = enclosedNode ); + } - if ( !selectedElement ) + if ( !selectedElement ) return; var selectionDir = useComputedState ?