Include the icon in the `Ui/Suggestion` result list
authorAlexander Ebert <ebert@woltlab.com>
Tue, 20 Nov 2018 11:23:00 +0000 (12:23 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 20 Nov 2018 11:23:00 +0000 (12:23 +0100)
See #2626

wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Suggestion.js

index 53d7f8140151050b39fc7552bfd42ce7376fd5d2..037fc06f2b73c2aae79c4dc6aa4ca81eda266c15 100644 (file)
@@ -230,7 +230,14 @@ define(['Ajax', 'Core', 'Ui/SimpleDropdown'], function(Ajax, Core, UiSimpleDropd
                                        item = data.returnValues[i];
                                        
                                        anchor = elCreate('a');
-                                       anchor.textContent = item.label;
+                                       if (item.icon) {
+                                               anchor.className = 'box16';
+                                               anchor.innerHTML = item.icon + ' <span></span>';
+                                               anchor.children[1].textContent = item.label;
+                                       }
+                                       else {
+                                               anchor.textContent = item.label;
+                                       }
                                        elData(anchor, 'object-id', item.objectID);
                                        anchor.addEventListener(WCF_CLICK_EVENT, this._select.bind(this));