mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 08:20:02 +00:00
Add check for placholder node in sub-ref create flow
Make it a bit more explicit when we want to remove that node and be a bit more verbose with comments. Bug: T375156 Change-Id: Ibb5efefa03037b99b50284071d06231e518530a6
This commit is contained in:
parent
863565ec3a
commit
ff1790755a
|
@ -241,10 +241,14 @@ ve.ui.MWReferenceDialog.prototype.getSetupProcess = function ( data ) {
|
|||
this.reuseSearch.setInternalList( this.getFragment().getDocument().getInternalList() );
|
||||
this.openReusePanel();
|
||||
} else if ( data.createSubRef ) {
|
||||
if ( this.selectedNode instanceof ve.dm.MWReferenceNode ) {
|
||||
if ( this.selectedNode instanceof ve.dm.MWReferenceNode &&
|
||||
this.selectedNode.getAttribute( 'placeholder' ) ) {
|
||||
// remove the placeholder node from Citoid
|
||||
this.getFragment().removeContent();
|
||||
this.selectedNode = null;
|
||||
|
||||
}
|
||||
// we never want to edit an existing node here
|
||||
this.selectedNode = null;
|
||||
this.onReuseSearchResultsExtends( data.createSubRef );
|
||||
} else {
|
||||
this.panels.setItem( this.editPanel );
|
||||
|
|
Loading…
Reference in a new issue