mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-12-01 01:56:20 +00:00
Only remove from internal list if unroot from correct document
Bug: T163267 Change-Id: I11ff56fbd437e46aab516a50235f8077eea0af5b
This commit is contained in:
parent
5b477ce3a1
commit
1fe0fb2e70
|
@ -29,7 +29,6 @@ QUnit.test( 'convert', function ( assert ) {
|
||||||
'</ol>',
|
'</ol>',
|
||||||
annotations: [],
|
annotations: [],
|
||||||
expectedData: [
|
expectedData: [
|
||||||
{ type: 'paragraph' },
|
|
||||||
{
|
{
|
||||||
type: 'mwReference',
|
type: 'mwReference',
|
||||||
attributes: {
|
attributes: {
|
||||||
|
@ -50,7 +49,6 @@ QUnit.test( 'convert', function ( assert ) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ type: '/mwReference' },
|
{ type: '/mwReference' },
|
||||||
{ type: '/paragraph' },
|
|
||||||
{ type: 'internalList' },
|
{ type: 'internalList' },
|
||||||
{ type: 'internalItem' },
|
{ type: 'internalItem' },
|
||||||
{ type: 'paragraph', internal: { generated: 'wrapper' } },
|
{ type: 'paragraph', internal: { generated: 'wrapper' } },
|
||||||
|
|
|
@ -365,9 +365,13 @@ ve.dm.MWReferenceNode.prototype.onRoot = function () {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle the node being detached from the root
|
* Handle the node being detached from the root
|
||||||
|
*
|
||||||
|
* @param {ve.dm.DocumentNode} oldRoot Old document root
|
||||||
*/
|
*/
|
||||||
ve.dm.MWReferenceNode.prototype.onUnroot = function () {
|
ve.dm.MWReferenceNode.prototype.onUnroot = function ( oldRoot ) {
|
||||||
this.removeFromInternalList();
|
if ( this.getDocument().getDocumentNode() === oldRoot ) {
|
||||||
|
this.removeFromInternalList();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue