mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 08:20:02 +00:00
Merge "Fix regression to auto-save"
This commit is contained in:
commit
685fdefd4e
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -9,9 +9,8 @@ function getFragmentMock( hasRefs ) {
|
|||
|
||||
return {
|
||||
getDocument: () => ( {
|
||||
getOriginalDocument: () => undefined,
|
||||
getStorage: () => docRefsMock,
|
||||
setStorage: () => undefined
|
||||
extCiteDocumentReferences: docRefsMock,
|
||||
getOriginalDocument: () => undefined
|
||||
} ),
|
||||
getSelection: () => ( {
|
||||
getName: () => 'linear'
|
||||
|
|
Loading…
Reference in a new issue