diff --git a/modules/realtimepreview/RealtimePreview.js b/modules/realtimepreview/RealtimePreview.js index 960d7152..b34b5d32 100644 --- a/modules/realtimepreview/RealtimePreview.js +++ b/modules/realtimepreview/RealtimePreview.js @@ -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 } );