Realtime Preview: make button toggle state more visible in MonoBook

Bug: T305953
Change-Id: Ibb0ee08837b7e3f5e98fa11d9e7a97dcef2dee9e
This commit is contained in:
MusikAnimal 2022-04-14 18:38:04 -04:00
parent 6e4bdee149
commit 472cf0c07c

View file

@ -79,7 +79,8 @@ RealtimePreview.prototype.getToolbarButton = function ( context ) {
label: mw.msg( 'wikieditor-realtimepreview-preview' ),
icon: 'article',
value: this.enabled,
framed: false
framed: false,
classes: [ 'tool' ] // T305953; So we can find usage of this class later: .tool
} );
this.button.connect( this, { change: this.toggle } );
return this.button;
@ -152,6 +153,7 @@ RealtimePreview.prototype.toggle = function () {
// Record the toggle state and update the button.
this.enabled = !this.enabled;
this.button.$element.toggleClass( 'tool-active', this.enabled ); // T305953
this.button.setFlags( { progressive: this.enabled } );
( new mw.Api() ).saveOption( this.prefName, this.enabled ? 1 : 0 );
};