Don't show empty search results on top of the search input field in the linkpicker

This commit is contained in:
Kenn Jacobsen
2020-01-08 10:01:20 +01:00
committed by Sebastiaan Janssen
parent e387c3b27f
commit a93cc88756
3 changed files with 6 additions and 4 deletions

View File

@@ -9,13 +9,14 @@ function treeSearchResults() {
return {
scope: {
results: "=",
selectResultCallback: "="
selectResultCallback: "=",
emptySearchResultPosition: '@'
},
restrict: "E", // restrict to an element
replace: true, // replace the html element with the template
templateUrl: 'views/components/tree/umb-tree-search-results.html',
link: function (scope, element, attrs, ctrl) {
scope.emptySearchResultPosition = scope.emptySearchResultPosition || "center";
}
};
}

View File

@@ -76,7 +76,8 @@
<umb-tree-search-results
ng-if="searchInfo.showSearch"
results="searchInfo.results"
select-result-callback="selectResult">
select-result-callback="selectResult"
empty-search-result-position="default">
</umb-tree-search-results>
<div ng-hide="searchInfo.showSearch">

View File

@@ -1,5 +1,5 @@
<div>
<umb-empty-state ng-if="results.length === 0" position="center">
<umb-empty-state ng-if="results.length === 0" position="{{emptySearchResultPosition}}">
<localize key="general_searchNoResult"></localize>
</umb-empty-state>