From 671a984c885feb443176a19f1d7e57fea868e1a0 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 17 Jul 2016 10:26:28 +0200 Subject: [PATCH] Readded support for perfect scrollbar --- wcfsetup/install/files/js/WCF.js | 4 +-- .../files/style/ui/perfectScrollbar.scss | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 wcfsetup/install/files/style/ui/perfectScrollbar.scss diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index d3e6aff552..032d892e8e 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1138,7 +1138,7 @@ WCF.Dropdown.Interactive.Instance = Class.extend({ this._pointer = $('').appendTo(this._container); require(['Environment'], function(Environment) { - if (Environment.platform() !== 'desktop' && $itemContainer !== null) { + if (Environment.platform() === 'desktop' && $itemContainer !== null) { // use jQuery scrollbar on desktop, mobile browsers have a similar display built-in $itemContainer.perfectScrollbar({ suppressScrollX: true @@ -1261,7 +1261,7 @@ WCF.Dropdown.Interactive.Instance = Class.extend({ */ rebuildScrollbar: function() { require(['Environment'], function(Environment) { - if (Environment.platform() !== 'desktop') { + if (Environment.platform() === 'desktop') { var $itemContainer = this._itemList.parent(); // do NOT use 'update', seems to be broken diff --git a/wcfsetup/install/files/style/ui/perfectScrollbar.scss b/wcfsetup/install/files/style/ui/perfectScrollbar.scss new file mode 100644 index 0000000000..6d4054b0f0 --- /dev/null +++ b/wcfsetup/install/files/style/ui/perfectScrollbar.scss @@ -0,0 +1,32 @@ +/* PerfectScrollbar plugin */ +.ps-container { + &:hover > .ps-scrollbar-y-rail > .ps-scrollbar-y { + background-color: rgba(102, 102, 102, .6); + } + + &.ps-active-y > .ps-scrollbar-y-rail { + display: block; + } + + > .ps-scrollbar-y-rail { + background-color: rgba(102, 102, 102, 0); + border-radius: 2px; + bottom: 0; + display: none; + position: absolute; + right: 2px; + transition: background-color .24s linear; + width: 6px; + + &:hover { + background-color: rgba(102, 102, 102, .3); + } + + > .ps-scrollbar-y { + background-color: rgba(102, 102, 102, 0); + border-radius: 2px; + position: relative; + transition: background-color .24s linear; + } + } +} -- 2.20.1