File tree 1 file changed +23
-3
lines changed
1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change 54
54
var colorPickers = [ ] ;
55
55
window . onload = function ( ) {
56
56
var inputColorPicker = document . getElementById ( 'Input_ColorPicker' ) ;
57
+ var buttonDestroyAll = document . getElementById ( 'Button_DestroyAll' ) ;
58
+ var buttonInitAll = document . getElementById ( 'Button_InitAll' ) ;
57
59
var inputColorPickerGroupWithoutTitle = document . getElementById ( 'Input_ColorPicker_GroupWithoutTitle' ) ;
58
60
inputColorPicker . colorList = [
59
61
{
70
72
]
71
73
}
72
74
] ;
73
- Array . prototype . forEach . call ( document . querySelectorAll ( '[data-colorpicker]' ) , function ( input ) {
74
- colorPickers . push ( new Colorpicker ( input ) ) ;
75
- } )
75
+
76
+ buttonInitAll . addEventListener ( 'click' , function ( ) {
77
+ Array . prototype . forEach . call ( document . querySelectorAll ( '[data-colorpicker]' ) , function ( input ) {
78
+ console . log ( 'input' , input ) ;
79
+ colorPickers . push ( new Colorpicker ( input ) ) ;
80
+ } )
81
+ } ) ;
82
+
83
+ buttonDestroyAll . addEventListener ( 'click' , function ( ) {
84
+ colorPickers . forEach ( function ( colorpicker ) {
85
+ colorpicker . destroy ( ) ;
86
+ } ) ;
87
+ colorPickers = [ ] ;
88
+ } ) ;
89
+
90
+
76
91
}
77
92
</ script >
78
93
</ head >
93
108
< legend > Disabled</ legend >
94
109
< input data-ng-model ="default " data-colorpicker type ="text " value ="" disabled />
95
110
</ fieldset >
111
+
112
+ < button id ="Button_InitAll "> Init All</ button >
113
+ < button id ="Button_DestroyAll "> Destroy All</ button >
114
+
115
+
96
116
</ body >
97
117
</ html >
You can’t perform that action at this time.
0 commit comments