Total Complexity | 4 |
Complexity/F | 1 |
Lines of Code | 44 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | var ImageSize = function(className) { |
||
2 | |||
3 | /** |
||
4 | * imageSize variable is created to represent ImageSize instance. |
||
5 | */ |
||
6 | var imageSize = this; |
||
7 | |||
8 | /** |
||
9 | * element variable is created to represent master element of the ImageSize. |
||
10 | */ |
||
11 | var element = $(className); |
||
12 | |||
13 | /** |
||
14 | * selectElement variable is created to represent select input of the PostType. |
||
15 | */ |
||
16 | var selectElement = element. |
||
17 | |||
18 | /** |
||
19 | * Initialize actions when create a ImageSize instance. |
||
20 | */ |
||
21 | this.init = function() { |
||
22 | // Initialize Select2 for select input. |
||
23 | imageSize.initializeSelect2(); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * Initialize Select2 for select input. |
||
28 | */ |
||
29 | this.initializeSelect2 = function() { |
||
30 | selectElement.select2(); |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Delete the ImageSize. |
||
35 | */ |
||
36 | this.delete = function() { |
||
37 | /* Remove the image size element. */ |
||
38 | element.remove(); |
||
39 | } |
||
40 | |||
41 | imageSize.init(); |
||
42 | } |
||
43 | |||
44 | module.exports = ImageSize; |