Disable hiding of the user menu on Redactor focus
authorAlexander Ebert <ebert@woltlab.com>
Mon, 25 Apr 2022 15:35:16 +0000 (17:35 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 25 Apr 2022 15:35:16 +0000 (17:35 +0200)
The behavior was intended to increase the available screen space when the editor is active. However, the height of smartphones has constantly increased, reducing the impact of a couple extra pixels.

The major downside was the focus behavior which is somewhat unintuitive on mobile and has repeatedly caused confusion among users, because the menu was seemingly “lost”.

wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabEvent.js
wcfsetup/install/files/style/layout/pageHeader.scss
wcfsetup/install/files/style/ui/pageAction.scss

index 890579aac9b034bd35739133e7cd166eaa76cc28..ff5dd5acaf62adc2a735e0e9266b616db16435b5 100644 (file)
@@ -15,21 +15,6 @@ $.Redactor.prototype.WoltLabEvent = function() {
                                }).bind(this))
                        }).bind(this));
                        
-                       var ua = window.navigator.userAgent.toLowerCase();
-                       if (ua.indexOf('windows phone') === -1 && ua.indexOf('edge/') === -1) {
-                               this.$editor[0].addEventListener('focus', function () {
-                                       document.documentElement.classList.add('redactorActive');
-                               });
-                               this.$editor[0].addEventListener('focusout', function () {
-                                       // short delay to prevent flickering when switching focus between editors
-                                       window.setTimeout(function () {
-                                               if (!document.activeElement || !document.activeElement.classList.contains('redactor-layer')) {
-                                                       document.documentElement.classList.remove('redactorActive');
-                                               }
-                                       }, 100);
-                               });
-                       }
-                       
                        this.events.iterateObserver = (function(mutation) {
                                var stop = false;
                                
index c1bcd960707dd41974d8b6bfd78284482e35f544..39bfbdb5c5358d7d0e3560849e071496af4adc5b 100644 (file)
                }
        }
 }
-
-@include screen-xs {
-       .pageHeaderPanel,
-       .pageHeaderFacade > .layoutBoundary {
-               transition: transform 0.12s linear;
-       }
-
-       .redactorActive {
-               .pageHeaderPanel,
-               .pageHeaderFacade > .layoutBoundary {
-                       transform: translateY(-120%);
-               }
-       }
-}
index 80c6c97b6ca95aed88c560a5443efce5fd596f64..774e970d5428b305e9534b4f689540080a8df591 100644 (file)
 .pageOverlayActive .pageAction {
        display: none;
 }
-
-@include screen-xs {
-       .redactorActive .pageAction {
-               bottom: 10px;
-
-               &:not(.pageActionHasContextButtons) {
-                       display: none !important;
-               }
-       }
-}