Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. Array.from(document.querySelectorAll('.section-device')).map(x => {
  2. var def = x.querySelector('.device').classList.item(1);
  3. var colors = Array.from(x.querySelectorAll('.dot.tooltip'))
  4. if (colors.length === 0) {
  5. return [{
  6. className: def,
  7. color: null
  8. }]
  9. }
  10. return colors.map(c => {
  11. return {
  12. className: `${def} ${c.getAttribute('data-tooltip')}`,
  13. color: c.getAttribute('style')
  14. }
  15. });
  16.  
  17. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement