Moved the filter input for FontAwesome icons to the top
authorAlexander Ebert <ebert@woltlab.com>
Mon, 22 Jul 2019 16:33:07 +0000 (18:33 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 22 Jul 2019 16:33:07 +0000 (18:33 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList/Filter.js
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Style/FontAwesome.js

index e45c816442fc82cd7f66a9fbcab1c9526331a45f..599fabcf1ca25b325fd79cb1ce90904393b49434 100644 (file)
@@ -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;
index 71e7ee3c273cb6497a4fd47589d6a127804faefb..d62f00d8a2ef313901c1499ba0ad103d580d64c7 100644 (file)
@@ -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
+});