public/js/maileclipse-app.js   A
last analyzed

Complexity

Total Complexity 5
Complexity/F 1.25

Size

Lines of Code 32
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 15
c 0
b 0
f 0
dl 0
loc 32
rs 10
wmc 5
mnd 1
bc 1
fnc 4
bpm 0.25
cpm 1.25
noi 1
1
$(document).ready(function(){
2
3
$.ajaxSetup({
4
  headers: {
5
    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
6
  },
7
});
8
9
axios.defaults.headers.common['X-CSRF-TOKEN'] = $('meta[name="csrf-token"]').attr('content');
0 ignored issues
show
Bug introduced by
The variable axios seems to be never declared. If this is a global, consider adding a /** global: axios */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
10
11
const el = document.querySelector('img');
12
    const observer = lozad(el); // passing a `NodeList` (e.g. `document.querySelectorAll()`) is also valid
13
    observer.observe();
14
15
16
$(function () {
17
    $('[data-toggle="popover"]').popover();
18
    $('[maileclipse-data-toggle="tooltip"]').tooltip();
19
})
20
21
$(document).on('click', function (e) {
22
    $('[data-toggle="popover"],[data-original-title]').each(function () {
23
        //the 'is' for buttons that trigger popups
24
        //the 'has' for icons within a button that triggers a popup
25
        if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {                
26
            (($(this).popover('hide').data('bs.popover')||{}).inState||{}).click = false  // fix for BS 3.3.6
27
        }
28
29
    });
30
});
31
32
});