jenkins-bot has submitted this change and it was merged.

Change subject: Followup 26fd3777: hide "Go back" in insertion mode
......................................................................


Followup 26fd3777: hide "Go back" in insertion mode

"Go back" should only be shown if there's something to go back to.
So it should be visible if you came from "Change image", but not
if you came from "Insert media".

If the "Go back" button is hidden, the footer is empty, so hide it
completely in that case. Hiding the footer is tricky due to how
dialogs position things, so I hacked around OO.ui.Dialog's lack
of an API for toggling the visibility of the footer.

Change-Id: Ic97c4a2bf7beaa240e5a4dfda1e605752e1f4189
---
M modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
1 file changed, 10 insertions(+), 1 deletion(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
index 013d963..9201c5e 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
@@ -630,6 +630,10 @@
                        this.changeImageButton.$element.show();
                        this.goBackButton.$element.hide();
                        this.applyButton.$element.show();
+                       // Show the foot in case it was hidden before
+                       this.$foot.show();
+                       // HACK: OO.ui.Dialog needs an API for this
+                       this.frame.$content.removeClass( 
'oo-ui-dialog-content-footless' );
                        // Hide/show the panels
                        this.bookletLayout.$element.show();
                        this.mediaSearchPanel.$element.hide();
@@ -666,8 +670,13 @@
                        this.panels.setItem( this.mediaSearchPanel );
                        // Hide/show buttons
                        this.changeImageButton.$element.hide();
-                       this.goBackButton.$element.show();
                        this.applyButton.$element.hide();
+                       // In insertion mode, hide the foot; in non-insertion 
mode, show "Go back"
+                       this.goBackButton.$element.toggle( !!this.imageModel );
+                       this.$foot.toggle( !!this.imageModel );
+                       // HACK: OO.ui.Dialog needs an API for this
+                       this.frame.$content.toggleClass( 
'oo-ui-dialog-content-footless', !this.imageModel );
+
                        // Hide/show the panels
                        this.bookletLayout.$element.hide();
                        this.mediaSearchPanel.$element.show();

-- 
To view, visit https://gerrit.wikimedia.org/r/143803
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic97c4a2bf7beaa240e5a4dfda1e605752e1f4189
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to