diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2017-06-06 18:18:31 -0500 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-06-06 18:18:31 -0500 |
commit | d565b30ce60e0ad83f8a63b235eb923524665712 (patch) | |
tree | eb541f60e1fd2f0780615cf10fc8652c29721240 /app/assets/javascripts/filtered_search | |
parent | f1dc6b57d78ff1af6758061873f2dd7e85feeff7 (diff) | |
download | gitlab-ce-d565b30ce60e0ad83f8a63b235eb923524665712.tar.gz |
Add jasmine spec for searchStateauto-search-when-state-changed
Diffstat (limited to 'app/assets/javascripts/filtered_search')
-rw-r--r-- | app/assets/javascripts/filtered_search/filtered_search_manager.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/filtered_search/filtered_search_manager.js b/app/assets/javascripts/filtered_search/filtered_search_manager.js index 4f0bba81e26..215cc81f256 100644 --- a/app/assets/javascripts/filtered_search/filtered_search_manager.js +++ b/app/assets/javascripts/filtered_search/filtered_search_manager.js @@ -506,9 +506,11 @@ class FilteredSearchManager { // return class name that has a prefix of `state-` const stateClassName = [].find.call(target.classList, name => name.match(/(state-)(\w+)/g)); - const state = stateClassName.replace('state-', ''); - this.search(state); + if (stateClassName) { + const state = stateClassName.replace('state-', ''); + this.search(state); + } } search(state = null) { |