• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / blurts-server / 93562ceb-caba-4ada-a7ce-dc7d1c1692ba

pending completion
93562ceb-caba-4ada-a7ce-dc7d1c1692ba

push

circleci

Vincent
Update filter results when clearing search field

282 of 1663 branches covered (16.96%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

959 of 4511 relevant lines covered (21.26%)

3.55 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/client/js/partials/allBreaches.js
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4

5
const allBreaches = document.querySelector('[data-partial="allBreaches"]')
×
6
let search, breachCards
7

8
function init () {
9
  search = document.getElementById('breach-search')
×
10
  search.value = ''
×
11
  search.addEventListener('input', filter)
×
12
  search.form.addEventListener('submit', filter)
×
13
  breachCards = allBreaches.querySelectorAll('.breach-card')
×
14
}
15

16
function filter (e) {
17
  e.preventDefault()
×
18

19
  if (search.value.length === 0) {
×
20
    breachCards.forEach(card => (card.style.display = ''))
×
21
  } else {
22
    breachCards.forEach(card => {
×
23
      if (card.text.toLowerCase().includes(search.value.toLowerCase())) {
×
24
        card.style.display = ''
×
25
      } else {
26
        card.style.display = 'none'
×
27
      }
28
    })
29
  }
30
}
31

32
if (allBreaches) init()
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc