Move search help to a more intuative spot
This commit is contained in:
parent
41be68ec6a
commit
bf7ee92d56
|
@ -59,12 +59,6 @@ export default function searchForTerm(term, opts) {
|
|||
}
|
||||
});
|
||||
|
||||
// a bit awkward, but we need to get the help link in
|
||||
// somehow
|
||||
if(results.resultTypes && results.resultTypes[0]) {
|
||||
results.resultTypes[0].showHelp = true;
|
||||
}
|
||||
|
||||
var noResults = !!(results.topics.length === 0 &&
|
||||
results.posts.length === 0 &&
|
||||
results.users.length === 0 &&
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
{{view 'search-text-field' value=term searchContextEnabled=searchContextEnabled searchContext=searchContext id="search-term"}}
|
||||
{{#if searchContext}}
|
||||
<div class='search-context'>
|
||||
<label>
|
||||
{{input type="checkbox" name="searchContext" checked=searchContextEnabled}} {{searchContextDescription}}
|
||||
</label>
|
||||
{{#if searchContext}}
|
||||
<label>
|
||||
{{input type="checkbox" name="searchContext" checked=searchContextEnabled}} {{searchContextDescription}}
|
||||
</label>
|
||||
{{/if}}
|
||||
<a href="#" class="show-help" {{action "showSearchHelp" bubbles=false}}>{{i18n show_help}}</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if loading}}
|
||||
<div class='searching'></div>
|
||||
{{else}}
|
||||
<div class="results">
|
||||
{{#unless noResults}}
|
||||
{{#each resultType in content.resultTypes}}
|
||||
<ul>
|
||||
|
@ -22,9 +24,6 @@
|
|||
<a href='#' class='filter' {{action "moreOfType" resultType.type bubbles=false}}>{{i18n show_more}} <i class="fa fa-chevron-down"></i></a>
|
||||
{{else}}
|
||||
{{/if}}
|
||||
{{#if resultType.showHelp}}
|
||||
<a href="#" class="show-help" {{action "showSearchHelp" bubbles=false}}>{{i18n show_help}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
|
@ -32,4 +31,5 @@
|
|||
{{i18n search.no_results}}
|
||||
</div>
|
||||
{{/unless}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
|
@ -339,3 +339,21 @@
|
|||
.search-highlight {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.search-context .show-help {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.search-context {
|
||||
min-height: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#search-dropdown .results {
|
||||
max-height: 300px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -72,13 +72,9 @@ and (max-width : 570px) {
|
|||
right: 30px;
|
||||
}
|
||||
|
||||
// leave room for scroll bar
|
||||
.d-dropdown input[type='text'] {
|
||||
width: 505px;
|
||||
}
|
||||
|
||||
.d-dropdown .no-results .show-help {
|
||||
position: absolute;
|
||||
right: 15px;
|
||||
|
||||
#search-dropdown .results {
|
||||
max-height: 500px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue