Merge "On file pages, only replace the (local) image description when saving"

This commit is contained in:
jenkins-bot 2014-05-19 17:51:08 +00:00 committed by Gerrit Code Review
commit 76a379b6cd

View file

@ -1514,8 +1514,16 @@ ve.init.mw.ViewPageTarget.prototype.onWindowPopState = function ( e ) {
* @param {string} categoriesHtml Rendered categories HTML from server
*/
ve.init.mw.ViewPageTarget.prototype.replacePageContent = function ( html, categoriesHtml ) {
var $content = $( $.parseHTML( html ) );
mw.hook( 'wikipage.content' ).fire( $( '#mw-content-text' ).empty().append( $content ) );
var $content = $( $.parseHTML( html ) ), $editableContent;
if ( $( '#mw-imagepage-content' ).length ) {
// On file pages, we only want to replace the (local) description.
$editableContent = $( '#mw-imagepage-content' );
} else {
$editableContent = $( '#mw-content-text' );
}
mw.hook( 'wikipage.content' ).fire( $editableContent.empty().append( $content ) );
$( '#catlinks' ).replaceWith( categoriesHtml );
};