From c890a2fdefaae2551897ce2f1b9f39d82b435dc2 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Thu, 19 Mar 2015 22:45:53 +0100 Subject: [PATCH] mediawiki.action.edit.preview: Disable if there is no #wpTextbox1 ProofreadPage has custom editforms for Index pages, which are not supported by the API. These editforms have no #wpTextbox1, so disable live preview in that case. Bug: T78709 Change-Id: I90cba79e5a4a756454741c4070ebdf620520ab55 --- .../src/mediawiki.action/mediawiki.action.edit.preview.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.preview.js b/resources/src/mediawiki.action/mediawiki.action.edit.preview.js index 3bf8e32b7a..84bde7d237 100644 --- a/resources/src/mediawiki.action/mediawiki.action.edit.preview.js +++ b/resources/src/mediawiki.action/mediawiki.action.edit.preview.js @@ -205,7 +205,8 @@ $( function () { // Do not enable on user .js/.css pages, as there's no sane way of "previewing" // the scripts or styles without reloading the page. - if ( $( '#mw-userjsyoucanpreview' ).length || $( '#mw-usercssyoucanpreview' ).length ) { + // Do not enable for ProofreadPage Index page editors, which have no textbox + if ( $( '#mw-userjsyoucanpreview' ).length || $( '#mw-usercssyoucanpreview' ).length || $( '#wpTextbox1' ).length === 0 ) { return; } -- 2.20.1