Disable editor bar toggle on WP/Edge
authorAlexander Ebert <ebert@woltlab.com>
Fri, 6 Jan 2017 16:42:18 +0000 (17:42 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 6 Jan 2017 16:42:18 +0000 (17:42 +0100)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabEvent.js

index 687c978a5d484a118e7f5ff6e2a2ffc5c2a92314..e8b78185991457d8f6541684ba95deda9966e9ae 100644 (file)
@@ -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) {