From bbdd7b9cb38f688bec46ce868bc7385155e54ce0 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 8 Oct 2013 21:40:00 +0200 Subject: [PATCH] mediawiki.action.edit.preview: Fix for LiquidThreads hack LiquidThreads is loading this core module when rendering an inline edit form. Because the form doesn't have the same ID as the one in core, this broke after becd284. It previously worked because the click event on the button (of which LQT did duplicate the ID from core) bubbles up to the document body and thus trigger this private handler of the core edit preview module. Change-Id: I9e35d0c48b86e1c9073b68313a8a330c6ea85b86 --- resources/mediawiki.action/mediawiki.action.edit.preview.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/mediawiki.action/mediawiki.action.edit.preview.js b/resources/mediawiki.action/mediawiki.action.edit.preview.js index d9ab97983f..c5cd61effa 100644 --- a/resources/mediawiki.action/mediawiki.action.edit.preview.js +++ b/resources/mediawiki.action/mediawiki.action.edit.preview.js @@ -127,7 +127,10 @@ ); } - $( '#editform' ).on( 'click', '#wpPreview, #wpDiff', doLivePreview ); + // This should be moved down to '#editform', but is kept on the body for now + // because the LiquidThreads extension is re-using this module with only half + // the EditPage (doesn't include #editform presumably, bug 55463). + $( document.body ).on( 'click', '#wpPreview, #wpDiff', doLivePreview ); } ); }( mediaWiki, jQuery ) ); -- 2.20.1