Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 't/9706b'
  • Loading branch information
Reinmar committed Dec 10, 2012
2 parents b2a6c6e + e972d8b commit 390e766
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 10 additions & 0 deletions core/dom/elementpath.js
Expand Up @@ -208,5 +208,15 @@ CKEDITOR.dom.elementPath.prototype = {

return true;

},

/**
* Retrieve the text direction for this elements path.
*
* @returns {'ltr'/'rtl'}
*/
direction: function() {
var directionNode = this.block || this.blockLimit || this.root;
return directionNode.getDirection( 1 );
}
};
7 changes: 4 additions & 3 deletions plugins/menu/plugin.js
Expand Up @@ -342,11 +342,12 @@ CKEDITOR.plugins.add( 'menu', {
// Put the items in the right order.
sortItems( items );

var chromeRoot = editor.container && editor.container.getChild( 1 ),
mixedContentClass = chromeRoot && chromeRoot.hasClass( 'cke_mixed_dir_content' ) ? ' cke_mixed_dir_content' : '';
// Apply the editor mixed direction status to menu.
var path = editor.elementPath(),
mixedDirCls = path.direction() != editor.lang.dir ? ' cke_mixed_dir_content' : '';

// Build the HTML that composes the menu and its items.
var output = [ '<div class="cke_menu' + mixedContentClass + '" role="presentation">' ];
var output = [ '<div class="cke_menu' + mixedDirCls + '" role="presentation">' ];

var length = items.length,
lastGroup = length && items[ 0 ].group;
Expand Down

0 comments on commit 390e766

Please sign in to comment.