mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Really fix notices sometimes not being an array
The previous fix didn't really work, because the notices are expected to be an array elsewhere too. Better to just convert it to an array on the spot. getObjectValues works with any kind of object (including an array) so it's safe to use with either data type. Change-Id: I03237b8624a0b980e5f70d54d55c662ffa460373
This commit is contained in:
parent
86cd5c6f57
commit
c0cd258045
|
@ -160,7 +160,7 @@ ve.init.mw.Target.onLoad = function ( response ) {
|
|||
this.originalHtml = data.content;
|
||||
this.doc = ve.createDocumentFromHtml( this.originalHtml );
|
||||
|
||||
this.remoteNotices = data.notices;
|
||||
this.remoteNotices = ve.getObjectValues( data.notices );
|
||||
|
||||
this.baseTimeStamp = data.basetimestamp;
|
||||
this.startTimeStamp = data.starttimestamp;
|
||||
|
@ -195,7 +195,7 @@ ve.init.mw.Target.onNoticesReady = function () {
|
|||
document.body.appendChild( tmp );
|
||||
|
||||
// Merge locally and remotely generated notices
|
||||
noticeHtmls = Array.prototype.slice.call( this.remoteNotices );
|
||||
noticeHtmls = this.remoteNotices.slice();
|
||||
for ( i = 0, len = this.localNoticeMessages.length; i < len; i++ ) {
|
||||
noticeHtmls.push(
|
||||
'<p>' + ve.init.platform.getParsedMessage( this.localNoticeMessages[i] ) + '</p>'
|
||||
|
|
Loading…
Reference in a new issue