ve.ui: Set the CM wrapper to the appropriate language

Bug: T341342
Change-Id: Ibdac3d360527429e396b0c124b57d1531b959a76
This commit is contained in:
Func 2023-07-07 20:48:25 +08:00
parent 87ef023efd
commit a19cd9b94a

View file

@ -211,9 +211,13 @@ ve.ui.CodeMirrorAction.prototype.onSelect = function ( selection ) {
*/
ve.ui.CodeMirrorAction.prototype.onLangChange = function () {
var surface = this.surface,
dir = surface.getView().getDocument().getDir();
doc = surface.getView().getDocument(),
dir = doc.getDir(), lang = doc.getLang();
surface.mirror.setOption( 'direction', dir );
// Set the wrapper to the appropriate language (T341342)
surface.mirror.getWrapperElement().setAttribute( 'lang', lang );
};
/**