Add an <html> class for the current surface's mode

Change-Id: I167a460e129969f1e25dde717df5f3cb4b67b34e
This commit is contained in:
Ed Sanders 2024-11-25 14:08:36 +00:00 committed by Esanders
parent 6d4caef304
commit 3a2df21703

View file

@ -424,7 +424,12 @@ ve.init.mw.DesktopArticleTarget.prototype.activate = function ( dataPromise ) {
* Edit mode has finished activating
*/
ve.init.mw.DesktopArticleTarget.prototype.afterActivate = function () {
$( 'html' ).removeClass( 've-activating' ).addClass( 've-active' );
// eslint-disable-next-line mediawiki/class-doc
$( 'html' )
// Remove ve-activating when loading for the first time,
// and when switching remove previous mode's class.
.removeClass( 've-activating ve-active-visual ve-active-source' )
.addClass( 've-active ve-active-' + this.getSurface().getMode() );
// Disable TemplateStyles in the original content
// (We do this here because toggling 've-active' class above hides it)