From c26f54c7268d7f2f061a5673822693e748a3dff9 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 7 Mar 2018 12:52:51 +0100 Subject: [PATCH] Disabled swipe-support in the mobile image viewer --- wcfsetup/install/files/js/WCF.ImageViewer.js | 9 ++++++++- wcfsetup/install/files/style/ui/imageViewer.scss | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WCF.ImageViewer.js b/wcfsetup/install/files/js/WCF.ImageViewer.js index 165f6f6567..133d15683d 100644 --- a/wcfsetup/install/files/js/WCF.ImageViewer.js +++ b/wcfsetup/install/files/js/WCF.ImageViewer.js @@ -368,6 +368,10 @@ $.widget('ui.wcfImageViewer', { setTimeout($.proxy(function() { if (this._isMobile && !this._container.hasClass('maximized')) { this._toggleView(); + + this._container[0].addEventListener(WCF_CLICK_EVENT, (function (event) { + if (!event.isDefaultPrevented && this._isMobile) this._toggleView(); + }).bind(this)); } }, this), 500); } @@ -933,6 +937,8 @@ $.widget('ui.wcfImageViewer', { _enableMobileView: function() { this._container.addClass('wcfImageViewerMobile'); + // the swipe-support conflicts with the ability to zoom in-and-out on images + /* var self = this; this._ui.imageContainer.swipe({ swipeLeft: function(event) { @@ -955,6 +961,7 @@ $.widget('ui.wcfImageViewer', { } } }); + */ this._isMobile = true; }, @@ -964,7 +971,7 @@ $.widget('ui.wcfImageViewer', { */ _disableMobileView: function() { this._container.removeClass('wcfImageViewerMobile'); - this._ui.imageContainer.swipe('destroy'); + //this._ui.imageContainer.swipe('destroy'); this._isMobile = false; }, diff --git a/wcfsetup/install/files/style/ui/imageViewer.scss b/wcfsetup/install/files/style/ui/imageViewer.scss index 142fcf5621..7a8212dcf3 100644 --- a/wcfsetup/install/files/style/ui/imageViewer.scss +++ b/wcfsetup/install/files/style/ui/imageViewer.scss @@ -52,6 +52,7 @@ $wcfImageViewerFontColor: rgba(211, 211, 211, 1); > header, > footer { opacity: 0; + pointer-events: none; visibility: hidden; transition: visibility 0s linear .24s, opacity .24s linear; @@ -59,6 +60,7 @@ $wcfImageViewerFontColor: rgba(211, 211, 211, 1); > div > ul > li.pointer { opacity: 0; + pointer-events: none; } } -- 2.20.1