Merge "Keep summary and checkbox selections when swtiching WTE->VE"

This commit is contained in:
jenkins-bot 2016-03-07 23:17:08 +00:00 committed by Gerrit Code Review
commit 39f3cfa4a7

View file

@ -55,7 +55,11 @@ ve.init.mw.DesktopArticleTarget = function VeInitMwDesktopArticleTarget( config
this.scrollTop = null;
this.currentUri = currentUri;
this.section = currentUri.query.vesection;
this.initialEditSummary = currentUri.query.summary;
if ( $( '#wpSummary' ).length ) {
this.initialEditSummary = $( '#wpSummary' ).val();
} else {
this.initialEditSummary = currentUri.query.summary;
}
this.namespaceName = mw.config.get( 'wgCanonicalNamespace' );
this.viewUri = new mw.Uri( mw.util.getUrl( this.pageName ) );
this.isViewPage = (
@ -285,6 +289,9 @@ ve.init.mw.DesktopArticleTarget.prototype.loadSuccess = function ( response ) {
( !!mw.user.options.get( 'watchcreations' ) && !this.pageExists ) ||
data.watched === ''
};
$( '.editCheckboxes input' ).each( function () {
defaults[ this.name ] = this.checked;
} );
$checkboxes = $( '<div>' ).html( ve.getObjectValues( data.checkboxes ).join( '' ) );
$checkboxes.find( 'input[type=checkbox]' ).each( function () {