Move search help to a more intuative spot

This commit is contained in:
Sam 2014-10-18 18:00:38 +11:00
parent 41be68ec6a
commit bf7ee92d56
4 changed files with 30 additions and 22 deletions

View File

@ -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 && var noResults = !!(results.topics.length === 0 &&
results.posts.length === 0 && results.posts.length === 0 &&
results.users.length === 0 && results.users.length === 0 &&

View File

@ -1,14 +1,16 @@
{{view 'search-text-field' value=term searchContextEnabled=searchContextEnabled searchContext=searchContext id="search-term"}} {{view 'search-text-field' value=term searchContextEnabled=searchContextEnabled searchContext=searchContext id="search-term"}}
{{#if searchContext}}
<div class='search-context'> <div class='search-context'>
{{#if searchContext}}
<label> <label>
{{input type="checkbox" name="searchContext" checked=searchContextEnabled}} {{searchContextDescription}} {{input type="checkbox" name="searchContext" checked=searchContextEnabled}} {{searchContextDescription}}
</label> </label>
{{/if}}
<a href="#" class="show-help" {{action "showSearchHelp" bubbles=false}}>{{i18n show_help}}</a>
</div> </div>
{{/if}}
{{#if loading}} {{#if loading}}
<div class='searching'></div> <div class='searching'></div>
{{else}} {{else}}
<div class="results">
{{#unless noResults}} {{#unless noResults}}
{{#each resultType in content.resultTypes}} {{#each resultType in content.resultTypes}}
<ul> <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> <a href='#' class='filter' {{action "moreOfType" resultType.type bubbles=false}}>{{i18n show_more}} <i class="fa fa-chevron-down"></i></a>
{{else}} {{else}}
{{/if}} {{/if}}
{{#if resultType.showHelp}}
<a href="#" class="show-help" {{action "showSearchHelp" bubbles=false}}>{{i18n show_help}}</a>
{{/if}}
</div> </div>
{{/each}} {{/each}}
{{else}} {{else}}
@ -32,4 +31,5 @@
{{i18n search.no_results}} {{i18n search.no_results}}
</div> </div>
{{/unless}} {{/unless}}
</div>
{{/if}} {{/if}}

View File

@ -339,3 +339,21 @@
.search-highlight { .search-highlight {
font-weight: bold; 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;
}

View File

@ -72,13 +72,9 @@ and (max-width : 570px) {
right: 30px; right: 30px;
} }
// leave room for scroll bar
.d-dropdown input[type='text'] { #search-dropdown .results {
width: 505px; max-height: 500px;
} overflow: auto;
.d-dropdown .no-results .show-help {
position: absolute;
right: 15px;
} }