From: Marcel Werk Date: Wed, 24 Aug 2016 10:41:08 +0000 (+0200) Subject: Clicking on a suggestion now submits the search form X-Git-Tag: 3.0.0_Beta_1~529 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9dd727cafda8c607b242e47c30f187b2bc4aba6a;p=GitHub%2FWoltLab%2FWCF.git Clicking on a suggestion now submits the search form --- 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; } });