mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Fix crash in MWExtensionNode creation mode
We can't get the directionality from the focused node if there isn't one. This doesn't add any logic to determine the directionality in creation mode, filed https://bugzilla.wikimedia.org/show_bug.cgi?id=57421 for that. Change-Id: I3ff8d48f19c7beef5e24b55712a26d86efa5812a
This commit is contained in:
parent
e9ad0c7b36
commit
1f8d01b72e
|
@ -66,10 +66,12 @@ ve.ui.MWExtensionInspector.prototype.setup = function ( data ) {
|
|||
this.node = this.surface.getView().getFocusedNode();
|
||||
this.input.setValue( this.node ? this.node.getModel().getAttribute( 'mw' ).body.extsrc : '' );
|
||||
|
||||
// Direction of the input textarea should correspond to the
|
||||
// direction of the surrounding content of the node itself
|
||||
// rather than the GUI direction:
|
||||
this.input.setRTL( this.node.$element.css( 'direction' ) === 'rtl' );
|
||||
if ( this.node ) {
|
||||
// Direction of the input textarea should correspond to the
|
||||
// direction of the surrounding content of the node itself
|
||||
// rather than the GUI direction:
|
||||
this.input.setRTL( this.node.$element.css( 'direction' ) === 'rtl' );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue