Passed
Push — master ( 533f19...962f84 )
by Markus
07:09 queued 02:25
created

Components/BlockCountUp/admin.js   A

Complexity

Total Complexity 8
Complexity/F 1.33

Size

Lines of Code 28
Function Count 6

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 8
eloc 17
mnd 2
bc 2
fnc 6
dl 0
loc 28
rs 10
bpm 0.3333
cpm 1.3333
noi 0
c 0
b 0
f 0
1
import $ from 'jquery'
2
3
$(document).ready(function () {
4
  var waitForEl = function (selector, callback) {
5
    if ($(selector).length) {
6
      callback()
7
    } else {
8
      setTimeout(function () {
9
        waitForEl(selector, callback)
10
      }, 100)
11
    }
12
  }
13
14
  if ($('[data-layout="BlockCountUp"]').closest('.values').length) {
15
    waitForEl('i[data-feather]', function () {
16
      $('i[data-feather]').closest('.select2-selection__rendered').removeAttr('title')
17
      window.feather.replace()
18
    })
19
  }
20
21
  $('body').on('click focusin', '.select2-container', function () {
22
    window.feather.replace()
23
  })
24
25
  $('body').on('keyup', '.select2-search__field', function () {
26
    window.feather.replace()
27
  })
28
})
29