From fe5db0c6b82f851b8a6e4005f2fed7347f500750 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 29 Oct 2013 16:53:52 +0100 Subject: [PATCH] Disable ImageViewer for Smartphones --- wcfsetup/install/files/js/WCF.ImageViewer.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.ImageViewer.js b/wcfsetup/install/files/js/WCF.ImageViewer.js index 0ad0913135..d13381c80f 100644 --- a/wcfsetup/install/files/js/WCF.ImageViewer.js +++ b/wcfsetup/install/files/js/WCF.ImageViewer.js @@ -40,6 +40,14 @@ WCF.ImageViewer = Class.extend({ * Initializes the image viewer for all links with class ".jsImageViewer" */ _initImageViewer: function() { + // disable ImageViewer on touch devices identifying themselves as 'mobile' + if ($.browser.touch && /[Mm]obile/.test(navigator.userAgent)) { + // Apple always appends mobile regardless if it is an iPad or iP(hone|od) + if (!/iPad/.test(navigator.userAgent)) { + return; + } + } + var $links = $('a.jsImageViewer'); if ($links.length) { $links.removeClass('jsImageViewer').slimbox({ -- 2.20.1