diff --git a/modules/ve-cite/ve.dm.MWDocumentReferences.js b/modules/ve-cite/ve.dm.MWDocumentReferences.js index 72b9477cc..a74a7d649 100644 --- a/modules/ve-cite/ve.dm.MWDocumentReferences.js +++ b/modules/ve-cite/ve.dm.MWDocumentReferences.js @@ -47,15 +47,15 @@ OO.mixinClass( ve.dm.MWDocumentReferences, OO.EventEmitter ); */ ve.dm.MWDocumentReferences.static.refsForDoc = function ( doc ) { let docRefs; + // Only use cache if we're working with the full document. if ( !doc.getOriginalDocument() ) { - // Only use cache if we're working with the full document. - docRefs = doc.getStorage( 'document-references-store' ); + docRefs = doc.extCiteDocumentReferences; } if ( docRefs === undefined ) { docRefs = new ve.dm.MWDocumentReferences( doc ); } if ( !doc.getOriginalDocument() ) { - doc.setStorage( 'document-references-store', docRefs ); + doc.extCiteDocumentReferences = docRefs; } return docRefs; }; diff --git a/tests/qunit/ve-cite/ve.ui.MWUseExistingReferenceCommand.test.js b/tests/qunit/ve-cite/ve.ui.MWUseExistingReferenceCommand.test.js index 3c2c4f10a..aae8c1f51 100644 --- a/tests/qunit/ve-cite/ve.ui.MWUseExistingReferenceCommand.test.js +++ b/tests/qunit/ve-cite/ve.ui.MWUseExistingReferenceCommand.test.js @@ -9,9 +9,8 @@ function getFragmentMock( hasRefs ) { return { getDocument: () => ( { - getOriginalDocument: () => undefined, - getStorage: () => docRefsMock, - setStorage: () => undefined + extCiteDocumentReferences: docRefsMock, + getOriginalDocument: () => undefined } ), getSelection: () => ( { getName: () => 'linear'