Passed
Push — master ( e298e7...38f0a8 )
by Rafael
01:23
created

control.js ➔ ???   A

Complexity

Conditions 1
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
c 2
b 0
f 0
nc 2
dl 0
loc 8
rs 9.4285
nop 1
1
import template from './template.html';
2
import './style.scss';
3
4
export class Control {
5
	constructor( options ) {
6
		this.options = _.defaults( options || {}, {
0 ignored issues
show
Bug introduced by
The variable _ seems to be never declared. If this is a global, consider adding a /** global: _ */ 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...
7
			name: _.random( 0, 10000 ),
8
			label: 'My Checkbox'
9
		} );
10
11
		this.template = _.template( template );
12
	}
13
14
	/**
15
	 * Create a checkbox and return the html.
16
	 *
17
	 * @since 1.0.0
18
	 *
19
	 * @return {jQuery} Control created.
20
	 */
21
	render() {
22
		this.$element = $( this.template( this.options ) );
23
		this.$input = this.$element.find( 'input' );
24
25
		return this.$element;
26
	}
27
}
28