mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
Merge "Quickfix for Transclusion icon in RTL wikis"
This commit is contained in:
commit
8b201c7dc4
|
@ -1566,3 +1566,11 @@ ve.ce.Surface.prototype.enableRendering = function () {
|
|||
ve.ce.Surface.prototype.disableRendering = function () {
|
||||
this.renderingEnabled = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Surface 'dir' property (Content-Level Direction)
|
||||
* @returns {string} 'ltr' or 'rtl'
|
||||
*/
|
||||
ve.ce.Surface.prototype.getDir = function () {
|
||||
return this.$.css( 'direction' );
|
||||
};
|
||||
|
|
|
@ -266,8 +266,8 @@ ve.ui.Context.prototype.updateDimensions = function ( transition ) {
|
|||
focusableWidth = focusedNode.$focusable.outerWidth();
|
||||
$container = this.$menu;
|
||||
position = { 'y': focusableOffset.top };
|
||||
// HACK: Proper RTL detection plz!
|
||||
if ( $( 'body' ).is( '.rtl,.ve-rtl' ) ) {
|
||||
// RTL check for Page-level (CE)
|
||||
if ( this.surface.view.getDir() === 'rtl' ) {
|
||||
position.x = focusableOffset.left;
|
||||
this.popup.align = 'left';
|
||||
} else {
|
||||
|
@ -278,7 +278,12 @@ ve.ui.Context.prototype.updateDimensions = function ( transition ) {
|
|||
$container = inspector ? this.inspectors.$ : this.$menu;
|
||||
this.popup.align = 'center';
|
||||
}
|
||||
this.$.css( { 'left': position.x, 'top': position.y } );
|
||||
// Flip left with right if CE is RTL
|
||||
if ( this.surface.view.getDir() === 'rtl' ) {
|
||||
this.$.css( { 'right': position.x, 'top': position.y } );
|
||||
} else {
|
||||
this.$.css( { 'left': position.x, 'top': position.y } );
|
||||
}
|
||||
this.popup.display(
|
||||
position.x,
|
||||
position.y,
|
||||
|
|
|
@ -250,3 +250,11 @@ ve.ui.Surface.prototype.addTriggers = function ( triggers, command ) {
|
|||
this.commands[trigger] = command.action;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Surface 'dir' property (GUI/User-Level Direction)
|
||||
* @returns {string} 'ltr' or 'rtl'
|
||||
*/
|
||||
ve.ui.Surface.prototype.getDir = function () {
|
||||
return this.$.css( 'direction' );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue