| Lines of Code | 29 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /*global document */ |
||
| 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) |
||
|
|
|||
| 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) { |
||
| 24 | |||
| 25 | }else if(this._page === 'list') { |
||
| 26 | new FormList() |
||
| 27 | } |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | new Admin() |
||