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

Change subject: Hide Details box when user taps the image
......................................................................


Hide Details box when user taps the image

On some devices this will give a little more space to see the image.
Initially state is always a visible details box.

Bug: T70504
Change-Id: Id93af2b3ad1bf3c2789522edb622d131c4c7a53a
---
M javascripts/modules/mediaViewer/ImageOverlay.js
1 file changed, 9 insertions(+), 1 deletion(-)

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



diff --git a/javascripts/modules/mediaViewer/ImageOverlay.js 
b/javascripts/modules/mediaViewer/ImageOverlay.js
index 2bd8d7e..e82c234 100644
--- a/javascripts/modules/mediaViewer/ImageOverlay.js
+++ b/javascripts/modules/mediaViewer/ImageOverlay.js
@@ -76,6 +76,13 @@
                        } );
 
                        $( window ).on( 'resize', $.proxy( this, 
'_positionImage' ) );
+
+                       this.$details = this.$( '.details' );
+
+                       this.$( '.image-wrapper' ).on( 'click', function () {
+                               self.$details.toggle();
+                               self._positionImage();
+                       } );
                },
 
                show: function () {
@@ -84,7 +91,8 @@
                },
 
                _positionImage: function () {
-                       var detailsHeight = this.$( '.details' ).outerHeight(),
+                       // with a hidden details box we have a little bit more 
space, we just need to use it
+                       var detailsHeight = !this.$details.is( ':visible' ) ? 0 
: this.$details.outerHeight(),
                                windowWidth = $( window ).width(),
                                windowHeight = $( window ).height() - 
detailsHeight,
                                windowRatio = windowWidth / windowHeight,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id93af2b3ad1bf3c2789522edb622d131c4c7a53a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to