mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Extension inspector directionality
Use a dir string instead of isLtr boolean like we do everywhere else. Also use this.constructor.static, not this.static inside methods. Fixes Ie0525628. Bug: 64072 Change-Id: I5321b71a446802d89ca86d55a0bff855b69825eb
This commit is contained in:
parent
25d1ca0659
commit
8070f48d27
|
@ -42,13 +42,15 @@ ve.ui.MWExtensionInspector.static.removable = false;
|
|||
ve.ui.MWExtensionInspector.static.allowedEmpty = false;
|
||||
|
||||
/**
|
||||
* Extension is forced to always be LTR; defaults to false
|
||||
* Inspector's directionality, 'ltr' or 'rtl'
|
||||
*
|
||||
* Leave as null to use the directionality of the current fragment.
|
||||
*
|
||||
* @static
|
||||
* @property {boolean}
|
||||
* @property {string|null}
|
||||
* @inheritable
|
||||
*/
|
||||
ve.ui.MWExtensionInspector.static.forcedLtr = false;
|
||||
ve.ui.MWExtensionInspector.static.dir = null;
|
||||
|
||||
/* Methods */
|
||||
|
||||
|
@ -97,7 +99,8 @@ ve.ui.MWExtensionInspector.prototype.setup = function ( data ) {
|
|||
|
||||
this.input.$input.attr( 'placeholder', this.getInputPlaceholder() );
|
||||
|
||||
this.input.setRTL( !this.static.forcedLtr && ( data.dir === 'rtl' ) );
|
||||
var dir = this.constructor.static.dir || data.dir;
|
||||
this.input.setRTL( dir === 'rtl' );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue