mirror of
https://github.com/flarum/framework.git
synced 2024-11-30 13:36:10 +08:00
Make search dropdown filtering case-insensitive. closes flarum/core#961
This commit is contained in:
parent
ddfc41c6f7
commit
f07abda4e6
6
framework/core/js/forum/dist/app.js
vendored
6
framework/core/js/forum/dist/app.js
vendored
|
@ -21470,6 +21470,8 @@ System.register('flarum/components/DiscussionsSearchSource', ['flarum/helpers/hi
|
|||
value: function search(query) {
|
||||
var _this = this;
|
||||
|
||||
query = query.toLowerCase();
|
||||
|
||||
this.results[query] = [];
|
||||
|
||||
var params = {
|
||||
|
@ -21485,6 +21487,8 @@ System.register('flarum/components/DiscussionsSearchSource', ['flarum/helpers/hi
|
|||
}, {
|
||||
key: 'view',
|
||||
value: function view(query) {
|
||||
query = query.toLowerCase();
|
||||
|
||||
var results = this.results[query] || [];
|
||||
|
||||
return [m(
|
||||
|
@ -28066,6 +28070,8 @@ System.register('flarum/components/UsersSearchSource', ['flarum/helpers/highligh
|
|||
}, {
|
||||
key: 'view',
|
||||
value: function view(query) {
|
||||
query = query.toLowerCase();
|
||||
|
||||
var results = app.store.all('users').filter(function (user) {
|
||||
return user.username().toLowerCase().substr(0, query.length) === query;
|
||||
});
|
||||
|
|
|
@ -13,6 +13,8 @@ export default class DiscussionsSearchSource {
|
|||
}
|
||||
|
||||
search(query) {
|
||||
query = query.toLowerCase();
|
||||
|
||||
this.results[query] = [];
|
||||
|
||||
const params = {
|
||||
|
@ -25,6 +27,8 @@ export default class DiscussionsSearchSource {
|
|||
}
|
||||
|
||||
view(query) {
|
||||
query = query.toLowerCase();
|
||||
|
||||
const results = this.results[query] || [];
|
||||
|
||||
return [
|
||||
|
|
|
@ -17,6 +17,8 @@ export default class UsersSearchResults {
|
|||
}
|
||||
|
||||
view(query) {
|
||||
query = query.toLowerCase();
|
||||
|
||||
const results = app.store.all('users')
|
||||
.filter(user => user.username().toLowerCase().substr(0, query.length) === query);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user