From: Matthias Schmidt Date: Mon, 23 Jan 2017 17:51:41 +0000 (+0100) Subject: Truncate ACP search result subtitles X-Git-Tag: 3.0.2~65 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=71c708238f5dc5326daf3d951aec5bc74552f46c;p=GitHub%2FWoltLab%2FWCF.git Truncate ACP search result subtitles --- 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. *