mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Update 'wgCurRevisionId' after successful save
Also updates the EventLogging code to use a computed property for 'wgCurRevisionId'. Change-Id: Ida648c77f56c0e455d6fb49a779a831734f6776b
This commit is contained in:
parent
ec8d7e4c06
commit
1780b4e39c
|
@ -844,11 +844,13 @@ ve.init.mw.ViewPageTarget.prototype.setUpEventLogging = function () {
|
|||
mw.eventLog.setDefaults( 'Edit', {
|
||||
version: 0,
|
||||
editor: 'visualeditor',
|
||||
pageId: +mw.config.get( 'wgArticleId' ),
|
||||
pageId: mw.config.get( 'wgArticleId' ),
|
||||
pageNs: mw.config.get( 'wgNamespaceNumber' ),
|
||||
pageName: mw.config.get( 'wgPageName' ),
|
||||
pageViewSessionId: +new Date(),
|
||||
revId: +mw.config.get( 'wgCurRevisionId' )
|
||||
revId: function () {
|
||||
return mw.config.get( 'wgCurRevisionId' );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
};
|
||||
|
|
|
@ -329,6 +329,7 @@ ve.init.mw.Target.onSave = function ( response ) {
|
|||
this, null, 'Invalid HTML content in response from server', null
|
||||
);
|
||||
} else {
|
||||
mw.config.set( 'wgCurRevisionId', data.newrevid );
|
||||
this.emit( 'save', data.content, data.newrevid );
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue