Prepare the ReferenceDialog to be opend for creating a sub-ref

The ReferenceDialog can be used to insert a new sub-ref and set
the additional details for that. Here I'm creating an entry point
for that workflow.

Bug: T375156
Change-Id: I47db21cd44d19ff209f9d5fa736bd6a057b983f2
This commit is contained in:
WMDE-Fisch 2024-10-09 11:00:25 +02:00
parent 39679be927
commit a776b8d753

View file

@ -230,6 +230,7 @@ ve.ui.MWReferenceDialog.prototype.getActionProcess = function ( action ) {
* @override
* @param {Object} [data] Setup data
* @param {boolean} [data.reuseReference=false] Open the dialog in "use existing reference" mode
* @param {ve.dm.MWReferenceModel} [data.createSubRef] Open the dialog to add additional details to a reuse
*/
ve.ui.MWReferenceDialog.prototype.getSetupProcess = function ( data ) {
data = data || {};
@ -239,6 +240,12 @@ ve.ui.MWReferenceDialog.prototype.getSetupProcess = function ( data ) {
if ( this.reuseReference ) {
this.reuseSearch.setInternalList( this.getFragment().getDocument().getInternalList() );
this.openReusePanel();
} else if ( data.createSubRef ) {
if ( this.selectedNode instanceof ve.dm.MWReferenceNode ) {
this.getFragment().removeContent();
this.selectedNode = null;
}
this.onReuseSearchResultsExtends( data.createSubRef );
} else {
this.panels.setItem( this.editPanel );
const docRefs = ve.dm.MWDocumentReferences.static.refsForDoc(