Truncate ACP search result subtitles
authorMatthias Schmidt <gravatronics@live.com>
Mon, 23 Jan 2017 17:51:41 +0000 (18:51 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 23 Jan 2017 17:51:41 +0000 (18:51 +0100)
wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/js/WCF.js

index b051066899ce8089c77bb975a6eef5196ceffab1..54585cd35e993cfac755a270aa39ec5265b29af7 100644 (file)
@@ -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()
         */
index 646687cbddb2e2dcc2c822b3344bece02d729cf0..f70c1706db443beddcb293774be5d99739395594 100755 (executable)
@@ -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.
         *