Merge "Rename showSidebar to expandSidebar for consistency"

This commit is contained in:
jenkins-bot 2021-09-16 12:36:09 +00:00 committed by Gerrit Code Review
commit 3486d9ea58

View file

@ -280,42 +280,42 @@ ve.ui.MWTransclusionDialog.prototype.getPageFromPart = function ( part ) {
* @private * @private
*/ */
ve.ui.MWTransclusionDialog.prototype.autoExpandSidebar = function () { ve.ui.MWTransclusionDialog.prototype.autoExpandSidebar = function () {
var showSidebar; var expandSidebar;
if ( this.useInlineDescriptions ) { if ( this.useInlineDescriptions ) {
var isSmallScreen = $( window ).width() <= this.constructor.static.smallScreenMaxWidth; var isSmallScreen = $( window ).width() <= this.constructor.static.smallScreenMaxWidth;
showSidebar = !isSmallScreen; expandSidebar = !isSmallScreen;
this.$otherActions.toggleClass( 'oo-ui-element-hidden', !isSmallScreen ); this.$otherActions.toggleClass( 'oo-ui-element-hidden', !isSmallScreen );
this.$content.toggleClass( 've-ui-mwTransclusionDialog-small-screen', isSmallScreen ); this.$content.toggleClass( 've-ui-mwTransclusionDialog-small-screen', isSmallScreen );
} else { } else {
showSidebar = !this.isSingleTemplateTransclusion(); expandSidebar = !this.isSingleTemplateTransclusion();
} }
this.toggleSidebar( showSidebar ); this.toggleSidebar( expandSidebar );
}; };
/** /**
* Set if the sidebar is visible (which means the dialog is expanded), or collapsed. * Set if the sidebar is visible (which means the dialog is expanded), or collapsed.
* *
* @param {boolean} showSidebar * @param {boolean} expandSidebar
* @private * @private
*/ */
ve.ui.MWTransclusionDialog.prototype.toggleSidebar = function ( showSidebar ) { ve.ui.MWTransclusionDialog.prototype.toggleSidebar = function ( expandSidebar ) {
if ( this.isSidebarExpanded === showSidebar ) { if ( this.isSidebarExpanded === expandSidebar ) {
return; return;
} }
this.isSidebarExpanded = showSidebar; this.isSidebarExpanded = expandSidebar;
this.$content this.$content
.toggleClass( 've-ui-mwTransclusionDialog-collapsed', !showSidebar ) .toggleClass( 've-ui-mwTransclusionDialog-collapsed', !expandSidebar )
.toggleClass( 've-ui-mwTransclusionDialog-expanded', showSidebar ); .toggleClass( 've-ui-mwTransclusionDialog-expanded', expandSidebar );
var dialogSizeSidebarExpanded = this.useInlineDescriptions ? 'larger' : 'large'; var dialogSizeSidebarExpanded = this.useInlineDescriptions ? 'larger' : 'large';
var dialogSizeSidebarCollapsed = this.useNewSidebar ? dialogSizeSidebarExpanded : 'medium'; var dialogSizeSidebarCollapsed = this.useNewSidebar ? dialogSizeSidebarExpanded : 'medium';
this.ignoreNextWindowResizeEvent = true; this.ignoreNextWindowResizeEvent = true;
this.setSize( showSidebar ? dialogSizeSidebarExpanded : dialogSizeSidebarCollapsed ); this.setSize( expandSidebar ? dialogSizeSidebarExpanded : dialogSizeSidebarCollapsed );
this.bookletLayout.toggleOutline( showSidebar ); this.bookletLayout.toggleOutline( expandSidebar );
this.updateTitle(); this.updateTitle();
this.updateModeActionState(); this.updateModeActionState();