浏览代码

HUE-7748 [frontend] Preselect the first entry in the global search result list

Johan Ahlen 8 年之前
父节点
当前提交
a770850
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      desktop/core/src/desktop/templates/ko_components/ko_global_search.mako

+ 2 - 0
desktop/core/src/desktop/templates/ko_components/ko_global_search.mako

@@ -128,6 +128,8 @@ from desktop.views import _ko
         self.selectedResult = ko.pureComputed(function () {
           if (self.selectedIndex()) {
             return self.searchResultCategories()[self.selectedIndex().categoryIndex].result[self.selectedIndex().resultIndex]
+          } else if (self.searchResultCategories().length > 0 && self.searchResultCategories()[0].result.length > 0) {
+            return self.searchResultCategories()[0].result[0];
           }
         }).extend({ deferred: true });;