From 7788aece5534a16a27c4481e105420528284bf7a Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Thu, 25 Feb 2016 10:33:14 +0000 Subject: [PATCH] After saving and setting HTML, set single-editor edit section handlers again Change-Id: I6e0962271e7e1460abbe82864b47fddc5bd7f235 --- .../init/targets/ve.init.mw.DesktopArticleTarget.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js index d59934af29..0fcd95ab88 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -1259,6 +1259,16 @@ ve.init.mw.DesktopArticleTarget.prototype.replacePageContent = function ( // Remove any VE-added redirectMsg $( '.redirectMsg' ).remove(); + // Re-set any single-editor edit section handlers + if ( + $content.find( '.mw-editsection' ).length && + !$content.find( '.mw-editsection-visualeditor' ).length + ) { + $content + .find( '.mw-editsection a' ) + .on( 'click', mw.libs.ve.onEditSectionLinkClick ); + } + mw.hook( 'wikipage.content' ).fire( $editableContent.empty().append( $content ) ); if ( displayTitle ) { $( '#content #firstHeading' ).html( displayTitle );