mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/WikiEditor
synced 2024-12-18 02:50:58 +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;
|
this.lastWikitext = null;
|
||||||
// Used to average response times and automatically disable realtime preview if it's very slow.
|
// Used to average response times and automatically disable realtime preview if it's very slow.
|
||||||
this.responseTimes = [];
|
this.responseTimes = [];
|
||||||
|
|
||||||
$( window ).on( 'resize', this.enableFeatureWhenScreenIsWideEnough.bind( this ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -105,6 +103,9 @@ RealtimePreview.prototype.getToolbarButton = function ( context ) {
|
||||||
this.button.toggle( false );
|
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.
|
// Add the onboarding popup.
|
||||||
var onboardingPopup = new OnboardingPopup();
|
var onboardingPopup = new OnboardingPopup();
|
||||||
this.button.connect( onboardingPopup, { change: onboardingPopup.onPreviewButtonClick } );
|
this.button.connect( onboardingPopup, { change: onboardingPopup.onPreviewButtonClick } );
|
||||||
|
|
Loading…
Reference in a new issue