ve.dm.MWReferenceNode: Override static cloneElement instead of getter

The getter isn't always used, but the static method is.

Change-Id: I9b3df7f4e8056cdb554c3ed9a27c39148b2b3237
This commit is contained in:
Ed Sanders 2016-05-04 14:34:23 +01:00 committed by Jforrester
parent 3d86dbeed3
commit 06376669d9

View file

@ -295,6 +295,17 @@ ve.dm.MWReferenceNode.static.getIndexLabel = function ( dataElement, internalLis
return '[' + ( refGroup ? refGroup + ' ' : '' ) + index + ']';
};
/**
* @inheritdoc
*/
ve.dm.MWReferenceNode.static.cloneElement = function () {
var clone = ve.dm.MWReferenceNode.super.static.cloneElement.apply( this, arguments );
delete clone.attributes.contentsUsed;
delete clone.attributes.mw;
delete clone.attributes.originalMw;
return clone;
};
/* Methods */
/**
@ -386,15 +397,6 @@ ve.dm.MWReferenceNode.prototype.removeFromInternalList = function () {
);
};
/** */
ve.dm.MWReferenceNode.prototype.getClonedElement = function () {
var clone = ve.dm.LeafNode.prototype.getClonedElement.call( this );
delete clone.attributes.contentsUsed;
delete clone.attributes.mw;
delete clone.attributes.originalMw;
return clone;
};
ve.dm.MWReferenceNode.prototype.onAttributeChange = function ( key, from, to ) {
if (
( key !== 'listGroup' && key !== 'listKey' ) ||