From: Timo Tijhof Date: Tue, 8 Oct 2013 19:40:00 +0000 (+0200) Subject: mediawiki.action.edit.preview: Fix for LiquidThreads hack X-Git-Tag: 1.31.0-rc.0~18568 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dcompta/operations/modifier.php?a=commitdiff_plain;h=bbdd7b9cb38f688bec46ce868bc7385155e54ce0;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ) );