This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/controllers/discovery-sortable.js.es6
Sam 078177cf79 FIX: show more results on search page was not performing a new search
We always want to update model if query params are changed on topic list
2015-07-13 11:13:13 +10:00

26 lines
870 B
JavaScript

import DiscourseController from 'discourse/controllers/controller';
// Just add query params here to have them automatically passed to topic list filters.
export var queryParams = {
order: { replace: true, refreshModel: true },
ascending: { replace: true, refreshModel: true },
status: { replace: true, refreshModel: true },
state: { replace: true, refreshModel: true },
search: { replace: true, refreshModel: true },
max_posts: { replace: true, refreshModel: true },
q: { replace: true, refreshModel: true }
};
// Basic controller options
var controllerOpts = {
needs: ['discovery/topics'],
queryParams: Ember.keys(queryParams)
};
// Aliases for the values
controllerOpts.queryParams.forEach(function(p) {
controllerOpts[p] = Em.computed.alias('controllers.discovery/topics.' + p);
});
export default DiscourseController.extend(controllerOpts);