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

caleb531 / flip-book / 10498867251

21 Aug 2024 11:12PM UTC coverage: 26.973% (+0.1%) from 26.831%
10498867251

push

github

caleb531
Replace classnames utility with clsx

72 of 101 branches covered (71.29%)

Branch coverage included in aggregate %.

0 of 14 new or added lines in 7 files covered. (0.0%)

386 of 1597 relevant lines covered (24.17%)

3.64 hits per line

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

0.0
/scripts/components/control.js
1
import m from 'mithril';
×
NEW
2
import clsx from 'clsx';
×
3
import PanelComponent from './panel.jsx';
×
4

×
5
class ControlComponent {
×
6

×
7
  view({attrs: {id, title, icon = null, label = null, action = null, panel = null, panelPosition = 'top'}}) {
×
8
    return m(`div.control.control-${id}`, {
×
NEW
9
      class: clsx({'control-has-label': label})
×
10
    }, [
×
11
      panel ? m(PanelComponent, {id, position: panelPosition}, panel) : null,
×
12
      m('button.control-button', {
×
13
        title,
×
14
        onclick: ({target}) => {
×
15
          if (panel) {
×
16
            PanelComponent.togglePanel(id);
×
17
          } else if (action) {
×
18
            // Do not close the panel where the clicked control resides
×
19
            if (!target.closest('.panel')) {
×
20
              PanelComponent.closeAllPanels();
×
21
            }
×
22
            action();
×
23
          }
×
24
        }
×
25
      }, [
×
26
        icon ? m('img.control-icon', {src: `icons/${icon}.svg`, alt: title}) : null,
×
27
        label ? m('span.control-label', label) : null
×
28
      ])
×
29
    ]);
×
30
  }
×
31

×
32
}
×
33

×
34
export default ControlComponent;
×
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