Completed
Push — master ( 3d58fe...e58be0 )
by
unknown
01:39
created

admin.js ➔ ... ➔ Array.forEach.call   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
nc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
/*global document */
2
3
import FormCreate from './modules/FormCreate'
4
import FormList from './modules/FormList'
5
6
class Admin {
7
  constructor() {
8
    this._page = document.querySelector('body').getAttribute('data-page')
9
    // this._formCreate = document.querySelector('.form-create')
10
    var forms = document.querySelectorAll('[data-form-abe-create]')
11
    Array.prototype.forEach.call(forms, function(form) {
12
      new FormCreate(form)      
0 ignored issues
show
Unused Code Best Practice introduced by
The object created with new FormCreate(form) is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...
13
    })
14
15
    this._bindEvents()
16
  }
17
18
  /**
19
   * _bindEvents for admin pages
20
   * @return {null}
21
   */
22
  _bindEvents() {
23
    if(typeof this._formCreate !== 'undefined' && this._formCreate !== null) {
0 ignored issues
show
Comprehensibility Documentation Best Practice introduced by
This code block is empty. Consider removing it or adding a comment to explain.
Loading history...
24
25
    }else if(this._page === 'list') {
26
      new FormList()
0 ignored issues
show
Unused Code Best Practice introduced by
The object created with new FormList() is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...
27
    }
28
  }
29
}
30
31
new Admin()
0 ignored issues
show
Unused Code Best Practice introduced by
The object created with new Admin() is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...