mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-12-17 18:40:45 +00:00
Merge "Realtime Preview: only add window-resize handler if toolbar button is used"
This commit is contained in:
commit
fb8dfd0e31
|
@ -68,8 +68,6 @@ function RealtimePreview() {
|
|||
this.lastWikitext = null;
|
||||
// Used to average response times and automatically disable realtime preview if it's very slow.
|
||||
this.responseTimes = [];
|
||||
|
||||
$( window ).on( 'resize', this.enableFeatureWhenScreenIsWideEnough.bind( this ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -105,6 +103,9 @@ RealtimePreview.prototype.getToolbarButton = function ( context ) {
|
|||
this.button.toggle( false );
|
||||
}
|
||||
|
||||
// Hide or show the preview and toolbar button when the window is resized.
|
||||
$( window ).on( 'resize', this.enableFeatureWhenScreenIsWideEnough.bind( this ) );
|
||||
|
||||
// Add the onboarding popup.
|
||||
var onboardingPopup = new OnboardingPopup();
|
||||
this.button.connect( onboardingPopup, { change: onboardingPopup.onPreviewButtonClick } );
|
||||
|
|
Loading…
Reference in a new issue