mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-09-23 10:26:26 +00:00
Realtime Preview: make button toggle state more visible in MonoBook
Bug: T305953 Change-Id: Ibb0ee08837b7e3f5e98fa11d9e7a97dcef2dee9e
This commit is contained in:
parent
6e4bdee149
commit
472cf0c07c
|
@ -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 );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue