From 02b4aefe03f68981765aa15363891bcaa2dc227e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 6 Jan 2017 17:42:18 +0100 Subject: [PATCH] Disable editor bar toggle on WP/Edge --- .../redactor2/plugins/WoltLabEvent.js | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabEvent.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabEvent.js index 687c978a5d..e8b7818599 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabEvent.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabEvent.js @@ -17,21 +17,24 @@ $.Redactor.prototype.WoltLabEvent = function() { }).bind(this)) }).bind(this)); - this.$editor[0].addEventListener('focus', function () { - _activeInstances++; - - document.documentElement.classList.add('redactorActive'); - }); - this.$editor[0].addEventListener('blur', function () { - _activeInstances--; - - // short delay to prevent flickering when switching focus between editors - window.setTimeout(function () { - if (_activeInstances === 0) { - document.documentElement.classList.remove('redactorActive'); - } - }, 100); - }) + var ua = window.navigator.userAgent.toLowerCase(); + if (ua.indexOf('windows phone') === -1 && ua.indexOf('edge/') === -1) { + this.$editor[0].addEventListener('focus', function () { + _activeInstances++; + + document.documentElement.classList.add('redactorActive'); + }); + this.$editor[0].addEventListener('blur', function () { + _activeInstances--; + + // short delay to prevent flickering when switching focus between editors + window.setTimeout(function () { + if (_activeInstances === 0) { + document.documentElement.classList.remove('redactorActive'); + } + }, 100); + }); + } }, _setEvents: function(EventHandler) { -- 2.20.1