mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 08:20:02 +00:00
[refactor] Inline single-use variables
Change-Id: Icee82498a9e7c9645ef2a9dc84be230a6d68ba42
This commit is contained in:
parent
56ccdd0e48
commit
850586c625
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue