From ca2ffa4853ed525a318000f2a80194898b7f61ca Mon Sep 17 00:00:00 2001 From: Adam Wight Date: Mon, 20 Sep 2021 11:00:00 +0200 Subject: [PATCH] Make citation dialog behave more like VE Applies new sidebar features to the Cite dialog, according to the VE feature flags. Bug: T291241 Change-Id: I1b7c191ae8fd1fa01808ea1e84ba72551f3d2331 --- modules/ve-cite/ve.ui.MWCitationDialog.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/ve-cite/ve.ui.MWCitationDialog.js b/modules/ve-cite/ve.ui.MWCitationDialog.js index 43bd3e14c..7930dedfd 100644 --- a/modules/ve-cite/ve.ui.MWCitationDialog.js +++ b/modules/ve-cite/ve.ui.MWCitationDialog.js @@ -18,6 +18,9 @@ ve.ui.MWCitationDialog = function VeUiMWCitationDialog( config ) { // Parent constructor ve.ui.MWCitationDialog.super.call( this, config ); + // Override feature set. + this.useBackButton = false; + // Properties this.referenceModel = null; this.referenceNode = null; @@ -26,7 +29,7 @@ ve.ui.MWCitationDialog = function VeUiMWCitationDialog( config ) { /* Inheritance */ -OO.inheritClass( ve.ui.MWCitationDialog, ve.ui.MWTemplateDialog ); +OO.inheritClass( ve.ui.MWCitationDialog, ve.ui.MWTransclusionDialog ); /* Static Properties */ @@ -34,6 +37,17 @@ ve.ui.MWCitationDialog.static.name = 'cite'; /* Methods */ +/** + * Hide the "show options" button when using the old workflow. + */ +ve.ui.MWCitationDialog.prototype.autoExpandSidebar = function () { + ve.ui.MWCitationDialog.super.prototype.autoExpandSidebar.call( this ); + + if ( !this.useInlineDescriptions && !this.useNewSidebar && !this.isSidebarExpanded ) { + this.$otherActions.toggleClass( 'oo-ui-element-hidden', true ); + } +}; + /** * Get the reference node to be edited. *