FIX: Don't mix camelCase into query params.

This commit is contained in:
Guo Xiang Tan 2016-10-13 14:43:47 +08:00
parent af90a04bd9
commit 1606ed01f9
4 changed files with 8 additions and 8 deletions

View File

@ -17,10 +17,10 @@ export default Ember.Controller.extend({
bulkSelectEnabled: null,
loading: Em.computed.not("model"),
queryParams: ["q", "isExpanded", "context_id", "context", "skip_context"],
queryParams: ["q", "expanded", "context_id", "context", "skip_context"],
q: null,
selected: [],
isExpanded: false,
expanded: false,
context_id: null,
context: null,
searching: false,
@ -138,9 +138,9 @@ export default Ember.Controller.extend({
return this.currentUser && this.currentUser.staff && hasResults;
},
@computed('isExpanded')
canCreateTopic() {
return this.currentUser && !this.site.mobileView && !this.get('isExpanded');
@computed('expanded')
canCreateTopic(expanded) {
return this.currentUser && !this.site.mobileView && !expanded;
},
_search() {

View File

@ -5,7 +5,7 @@ import PreloadStore from 'preload-store';
import { getTransient, setTransient } from 'discourse/lib/page-tracker';
export default Discourse.Route.extend({
queryParams: { q: {}, isExpanded: false, context_id: {}, context: {}, skip_context: {} },
queryParams: { q: {}, expanded: false, context_id: {}, context: {}, skip_context: {} },
model(params) {
const cached = getTransient('lastSearch');

View File

@ -2,7 +2,7 @@
{{search-text-field value=searchTerm class="full-page-search input-xxlarge search no-blur" action="search" hasAutofocus=hasAutofocus}}
{{d-button action="search" icon="search" class="btn-primary" disabled=searching}}
{{search-advanced-options searchTerm=searchTerm isExpanded=isExpanded}}
{{search-advanced-options searchTerm=searchTerm isExpanded=expanded}}
{{#if canCreateTopic}}
<span class="new-topic-btn">{{d-button id="create-topic" class="btn-default" action="createTopic" actionParam=searchTerm icon="plus" label="topic.create"}}</span>

View File

@ -44,7 +44,7 @@ createWidget('search-context', {
]));
}
result.push(this.attach('link', { href: Discourse.getURL('/search?isExpanded=true'),
result.push(this.attach('link', { href: Discourse.getURL('/search?expanded=true'),
label: 'show_help',
className: 'show-help' }));
result.push(h('div.clearfix'));