From 9dd727cafda8c607b242e47c30f187b2bc4aba6a Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Wed, 24 Aug 2016 12:41:08 +0200 Subject: [PATCH] Clicking on a suggestion now submits the search form --- .../install/files/js/WoltLabSuite/Core/Ui/Search/Page.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Page.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Page.js index 522352a289..70ae1b6d81 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Page.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Search/Page.js @@ -1,4 +1,4 @@ -define(['Core', 'Dom/Util', 'Ui/SimpleDropdown', './Input'], function(Core, DomUtil, UiSimpleDropdown, UiSearchInput) { +define(['Core', 'Dom/Traverse', 'Dom/Util', 'Ui/SimpleDropdown', './Input'], function(Core, DomTraverse, DomUtil, UiSimpleDropdown, UiSearchInput) { "use strict"; return { @@ -22,6 +22,13 @@ define(['Core', 'Dom/Util', 'Ui/SimpleDropdown', './Input'], function(Core, DomU var offsetRight = (DomUtil.offset(parent).left + parent.clientWidth) - (DomUtil.offset(searchInput).left + minWidth); var offsetTop = DomUtil.styleAsInt(window.getComputedStyle(parent), 'padding-bottom'); dropdownMenu.style.setProperty('transform', 'translateX(-' + Math.ceil(offsetRight) + 'px) translateY(-' + offsetTop + 'px)', ''); + }, + callbackSelect: function() { + setTimeout(function() { + DomTraverse.parentByTag(searchInput, 'FORM').submit(); + }, 1); + + return true; } }); -- 2.20.1