From 71c708238f5dc5326daf3d951aec5bc74552f46c Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 23 Jan 2017 18:51:41 +0100 Subject: [PATCH] Truncate ACP search result subtitles --- wcfsetup/install/files/acp/js/WCF.ACP.js | 11 +++++++++++ wcfsetup/install/files/js/WCF.js | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index b051066899..54585cd35e 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -1830,6 +1830,17 @@ WCF.ACP.Search = WCF.Search.Base.extend({ } }, + /** + * @see WCF.Search.Base._openDropdown() + */ + _openDropdown: function() { + this._list.find('small').each(function(index, element) { + while (element.scrollWidth > element.clientWidth) { + element.innerText = '\u2026 ' + element.innerText.substr(3); + } + }); + }, + /** * @see WCF.Search.Base._handleEmptyResult() */ diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 646687cbdd..f70c1706db 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -4338,6 +4338,8 @@ WCF.Search.Base = Class.extend({ var $containerID = this._searchInput.parents('.dropdown').wcfIdentify(); if (!WCF.Dropdown.getDropdownMenu($containerID).hasClass('dropdownOpen')) { WCF.Dropdown.toggleDropdown($containerID); + + this._openDropdown(); } // pre-select first item @@ -4347,6 +4349,13 @@ WCF.Search.Base = Class.extend({ } }, + /** + * Is called after the dropdown has been opened. + */ + _openDropdown: function() { + // does nothing + }, + /** * Handles empty result lists, should return false if dropdown should be hidden. * -- 2.20.1