[refactor] Inline single-use variables

Change-Id: Icee82498a9e7c9645ef2a9dc84be230a6d68ba42
This commit is contained in:
Adam Wight 2024-08-26 10:50:36 +02:00 committed by Awight
parent 56ccdd0e48
commit 850586c625

View file

@ -151,8 +151,6 @@ ve.ui.MWCitationDialog.prototype.getActionProcess = function ( action ) {
this.checkRequiredParameters().done( () => {
const surfaceModel = this.getFragment().getSurface();
const doc = surfaceModel.getDocument();
const internalList = doc.getInternalList();
const obj = this.transclusionModel.getPlainObject();
// We had a reference, but no template node (or wrong kind of template node)
if ( this.referenceModel && !this.selectedNode ) {
@ -180,7 +178,7 @@ ve.ui.MWCitationDialog.prototype.getActionProcess = function ( action ) {
this.transclusionModel.updateTransclusionNode(
surfaceModel, this.selectedNode
);
} else if ( obj !== null ) {
} else if ( this.transclusionModel.getPlainObject() !== null ) {
this.transclusionModel.insertTransclusionNode(
// HACK: This is trying to place the cursor inside the first
// content branch node but this theoretically not a safe
@ -203,7 +201,7 @@ ve.ui.MWCitationDialog.prototype.getActionProcess = function ( action ) {
// someone fixes that
this.referenceModel.setDocument(
doc.cloneFromRange(
internalList.getItemNode( this.referenceModel.getListIndex() ).getRange()
doc.getInternalList().getItemNode( this.referenceModel.getListIndex() ).getRange()
)
);
this.referenceModel.updateInternalItem( surfaceModel );