From 7308a8fa1a28ea6515f3656a5356d895b1a5c042 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 22 Jul 2019 18:33:07 +0200 Subject: [PATCH] Moved the filter input for FontAwesome icons to the top --- .../js/WoltLabSuite/Core/Ui/ItemList/Filter.js | 14 ++++++++++++-- .../js/WoltLabSuite/Core/Ui/Style/FontAwesome.js | 5 +++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList/Filter.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList/Filter.js index e45c816442..599fabcf1c 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList/Filter.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList/Filter.js @@ -43,9 +43,14 @@ define(['Core', 'EventKey', 'Language', 'List', 'StringUtil', 'Dom/Util', 'Ui/Si this._options = Core.extend({ callbackPrepareItem: undefined, - enableVisibilityFilter: true + enableVisibilityFilter: true, + filterPosition: 'bottom' }, options); + if (this._options.filterPosition !== 'top') { + this._options.filterPosition = 'bottom'; + } + var element = elById(elementId); if (element === null) { throw new Error("Expected a valid element id, '" + elementId + "' does not match anything."); @@ -100,7 +105,12 @@ define(['Core', 'EventKey', 'Language', 'List', 'StringUtil', 'Dom/Util', 'Ui/Si inputAddon.appendChild(visibilityButton); } - container.appendChild(inputAddon); + if (this._options.filterPosition === 'bottom') { + container.appendChild(inputAddon); + } + else { + container.insertBefore(inputAddon, element); + } this._container = container; this._dropdown = null; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Style/FontAwesome.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Style/FontAwesome.js index 71e7ee3c27..d62f00d8a2 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Style/FontAwesome.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Style/FontAwesome.js @@ -99,7 +99,8 @@ define(['Language', 'Ui/Dialog', 'WoltLabSuite/Core/Ui/ItemList/Filter'], functi text: text }; }, - enableVisibilityFilter: false + enableVisibilityFilter: false, + filterPosition: 'top' }); }).bind(this), onShow: function () { @@ -111,4 +112,4 @@ define(['Language', 'Ui/Dialog', 'WoltLabSuite/Core/Ui/ItemList/Filter'], functi }; } } -}); \ No newline at end of file +}); -- 2.20.1