mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-18 08:43:37 +00:00
Add search of grouped options in shows drop down at view-show.
Select child options were not considered in show name matching.
This commit is contained in:
parent
d719765040
commit
6f5695d3ef
2 changed files with 27 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
|||
* Fix regex that was not using py312 notation
|
||||
* Change sort backlog and manual segment search results episode number
|
||||
* Change sort episodes when set to wanted on display show page
|
||||
* Add search of grouped options in shows drop down at view-show
|
||||
|
||||
|
||||
### 3.29.8 (2023-09-12 08:10:00 UTC)
|
||||
|
|
|
@ -59,8 +59,33 @@ $(document).ready(function() {
|
|||
}
|
||||
|
||||
// `params.term` should be the term that is used for searching
|
||||
// `data.text` is the text that is displayed for the data object
|
||||
var param_term = params.term.toLowerCase().trim().replace(white_space_regex, '');
|
||||
|
||||
if ('undefined' !== typeof data.children) {
|
||||
// `data.children` contains options to match against
|
||||
var filteredChildren = [];
|
||||
$.each(data.children, function (idx, child) {
|
||||
// `child.text` is the text that is displayed for the data object
|
||||
var param_data = child.text.toLowerCase().trim().replace(white_space_regex, '');
|
||||
|
||||
if (fuzzysearch(param_term, param_data)) {
|
||||
filteredChildren.push(child);
|
||||
}
|
||||
});
|
||||
|
||||
// If any of the group's children match,
|
||||
// then set the matched children on the group and return the group object
|
||||
if (filteredChildren.length) {
|
||||
var modifiedData = $.extend({}, data, true);
|
||||
modifiedData.children = filteredChildren;
|
||||
|
||||
// You can return modified objects from here
|
||||
// This includes matching the `children` how you want in nested data sets
|
||||
return modifiedData;
|
||||
}
|
||||
}
|
||||
|
||||
// `data.text` is the text that is displayed for the data object
|
||||
var param_data = data.text.toLowerCase().trim().replace(white_space_regex, '');
|
||||
if (fuzzysearch(param_term, param_data)) {
|
||||
var modifiedData = $.extend({}, data, true);
|
||||
|
|
Loading…
Reference in a new issue