Skip to content

Commit

Permalink
Fix geosolutions-it#2534 IE11 load problem
Browse files Browse the repository at this point in the history
  • Loading branch information
MV88 committed Jan 19, 2018
1 parent 9ec8b5a commit 0e07a08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion web/client/components/TOC/DefaultLayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ class DefaultLayer extends React.Component {
filterLayers = (layer) => {
const translation = isObject(layer.title) ? layer.title[this.props.currentLocale] || layer.title.default : layer.title;
const title = translation || layer.name;
return title.toLowerCase().includes(this.props.filterText.toLowerCase());
const testRegex = new RegExp(this.props.filterText.toLowerCase());
return testRegex.test(title.toLowerCase());
}
}

Expand Down
3 changes: 2 additions & 1 deletion web/client/plugins/TOC.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ const addFilteredAttributesGroups = (nodes, filters) => {
const filterLayersByTitle = (layer, filterText, currentLocale) => {
const translation = isObject(layer.title) ? layer.title[currentLocale] || layer.title.default : layer.title;
const title = translation || layer.name;
return title.toLowerCase().includes(filterText.toLowerCase());
const testRegex = new RegExp(filterText.toLowerCase());
return testRegex.test(title.toLowerCase());
};

const tocSelector = createSelector(
Expand Down

0 comments on commit 0e07a08

Please sign in to comment.