mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-28 00:40:12 +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>',
|
||||
annotations: [],
|
||||
expectedData: [
|
||||
{ type: 'paragraph' },
|
||||
{
|
||||
type: 'mwReference',
|
||||
attributes: {
|
||||
|
@ -50,7 +49,6 @@ QUnit.test( 'convert', function ( assert ) {
|
|||
}
|
||||
},
|
||||
{ type: '/mwReference' },
|
||||
{ type: '/paragraph' },
|
||||
{ type: 'internalList' },
|
||||
{ type: 'internalItem' },
|
||||
{ type: 'paragraph', internal: { generated: 'wrapper' } },
|
||||
|
|
|
@ -365,9 +365,13 @@ ve.dm.MWReferenceNode.prototype.onRoot = function () {
|
|||
|
||||
/**
|
||||
* 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 ) {
|
||||
if ( this.getDocument().getDocumentNode() === oldRoot ) {
|
||||
this.removeFromInternalList();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue