diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js b/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js index 3211b12c1b..f0476ef5c1 100644 --- a/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js +++ b/modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js @@ -143,8 +143,7 @@ ve.ce.MWBlockImageNode.prototype.updateCaption = function () { } } if ( this.$caption ) { - // Don't use show() as it sets display to block, overriding the stylesheet. - this.$caption.css( 'display', this.captionVisible ? '' : 'none' ); + this.$caption.toggleClass( 'oo-ui-element-hidden', !this.captionVisible ); } }; diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js index adf98e4e76..697c138ab6 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js @@ -1098,17 +1098,17 @@ ve.ui.MWMediaDialog.prototype.switchPanels = function ( panel, stopSearchRequery // The filerepo promise will be sent to the API // only once per session so this will be resolved // every time the search panel reloads - this.$spinner.show(); - this.search.$element.hide(); + this.$spinner.removeClass( 'oo-ui-element-hidden' ); + this.search.toggle( false ); // Get the repos from the API first // The ajax request will only be done once per session dialog.getFileRepos().done( function ( repos ) { dialog.search.setSources( repos ); // Done, hide the spinner - dialog.$spinner.hide(); + dialog.$spinner.addClass( 'oo-ui-element-hidden' ); // Show the search and query the media sources - dialog.search.$element.show(); + dialog.search.toggle( true ); dialog.search.query.setValue( dialog.pageTitle ); dialog.search.queryMediaSources(); // Initialization @@ -1168,7 +1168,7 @@ ve.ui.MWMediaDialog.prototype.attachImageModel = function () { ); // Size widget - this.sizeErrorLabel.$element.hide(); + this.sizeErrorLabel.toggle( false ); this.sizeWidget.setScalable( this.imageModel.getScalable() ); this.sizeWidget.connect( this, { changeSizeType: 'checkChanged', diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js index 63bfc225d4..81e8f38a59 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js @@ -267,13 +267,13 @@ ve.ui.MWReferenceDialog.prototype.useReference = function ( ref ) { group = this.getFragment().getDocument().getInternalList() .getNodeGroup( this.referenceModel.getListGroup() ); if ( group && group.keyedNodes[this.referenceModel.getListKey()].length > 1 ) { - this.$reuseWarning.show(); + this.$reuseWarning.removeClass( 'oo-ui-element-hidden' ); this.$reuseWarningText.text( mw.msg( 'visualeditor-dialog-reference-editing-reused', group.keyedNodes[this.referenceModel.getListKey()].length ) ); } else { - this.$reuseWarning.hide(); + this.$reuseWarning.addClass( 'oo-ui-element-hidden' ); } return this; diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js index 1f1e9a08be..551813b619 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js @@ -203,20 +203,22 @@ ve.ui.MWSaveDialog.prototype.swapPanel = function ( panel ) { if ( !currentEditSummaryWikitext || currentEditSummaryWikitext.trim() === '' ) { // Don't bother with an API request for an empty summary - this.$reviewEditSummary.parent().hide(); + this.$reviewEditSummary.parent().addClass( 'oo-ui-element-hidden' ); } else { - this.$reviewEditSummary.parent().show().addClass( 'mw-ajax-loader' ); + this.$reviewEditSummary.parent() + .removeClass( 'oo-ui-element-hidden' ) + .addClass( 'mw-ajax-loader' ); this.editSummaryXhr = new mw.Api().post( { action: 'parse', summary: currentEditSummaryWikitext } ).done( function ( result ) { if ( result.parse.parsedsummary['*'] === '' ) { - dialog.$reviewEditSummary.parent().hide(); + dialog.$reviewEditSummary.parent().addClass( 'oo-ui-element-hidden' ); } else { dialog.$reviewEditSummary.html( ve.msg( 'parentheses', result.parse.parsedsummary['*'] ) ); } } ).fail( function () { - dialog.$reviewEditSummary.parent().hide(); + dialog.$reviewEditSummary.parent().addClass( 'oo-ui-element-hidden' ); } ).always( function () { dialog.$reviewEditSummary.parent().removeClass( 'mw-ajax-loader' ); } ); diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js index 74c2c269cf..7ab676cdf4 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWCategoryPopupWidget.js @@ -48,7 +48,9 @@ ve.ui.MWCategoryPopupWidget = function VeUiMWCategoryPopupWidget( config ) { this.$sortKeyForm.on( 'submit', this.onSortKeySubmit.bind( this ) ); // Initialization - this.$element.addClass( 've-ui-mwCategoryPopupWidget' ).hide(); + this.$element + .addClass( 've-ui-mwCategoryPopupWidget' ); + this.toggle( false ); this.$title .addClass( 've-ui-mwCategoryPopupWidget-title oo-ui-icon-tag' ) .text( ve.msg( 'visualeditor-dialog-meta-categories-category' ) ); diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWMediaResultWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWMediaResultWidget.js index f555503c6c..62d0421c5f 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWMediaResultWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWMediaResultWidget.js @@ -55,7 +55,7 @@ ve.ui.MWMediaResultWidget = function VeUiMWMediaResultWidget( config ) { label: ve.msg( 'visualeditor-dialog-media-searchselect' ), icon: 'check' } ); - this.selectButton.$element.hide(); + this.selectButton.toggle( false ); this.$element.prepend( this.selectButton.$element ); }; diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js index 90f540d122..94a5744ccf 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWMediaSearchWidget.js @@ -42,9 +42,8 @@ ve.ui.MWMediaSearchWidget = function VeUiMWMediaSearchWidget( config ) { this.rows = []; this.$noItemsMessage = this.$( '