diff options
author | Mike Greiling <mgreiling@gitlab.com> | 2017-08-04 11:07:05 +0300 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2017-08-04 11:07:05 +0300 |
commit | 7256626d6023869fac7ffdcfe3d291b76fb19e64 (patch) | |
tree | 2234178ec35755eedce1b4251b7bdbe05ad7ff1f /app/assets/javascripts/filtered_search/dropdown_utils.js | |
parent | fe5086c28f4ff979184c3dc9945a599ce7ecf8b2 (diff) |
Remove monkey-patched Array.prototype.first() and last() methods
Diffstat (limited to 'app/assets/javascripts/filtered_search/dropdown_utils.js')
-rw-r--r-- | app/assets/javascripts/filtered_search/dropdown_utils.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/filtered_search/dropdown_utils.js b/app/assets/javascripts/filtered_search/dropdown_utils.js index db5560fa753..8d711e3213c 100644 --- a/app/assets/javascripts/filtered_search/dropdown_utils.js +++ b/app/assets/javascripts/filtered_search/dropdown_utils.js @@ -123,11 +123,11 @@ class DropdownUtils { if (!allowMultiple && itemInExistingTokens) { updatedItem.droplab_hidden = true; - } else if (!lastKey || searchInput.split('').last() === ' ') { + } else if (!lastKey || _.last(searchInput.split('')) === ' ') { updatedItem.droplab_hidden = false; } else if (lastKey) { const split = lastKey.split(':'); - const tokenName = split[0].split(' ').last(); + const tokenName = _.last(split[0].split(' ')); const match = updatedItem.hint.indexOf(tokenName.toLowerCase()) === -1; updatedItem.droplab_hidden = tokenName ? match : false; |