File tree 1 file changed +25
-5
lines changed
1 file changed +25
-5
lines changed Original file line number Diff line number Diff line change 80
80
width : 50% ;
81
81
}
82
82
83
- .codemirror-container # run-button {
83
+ .editor-actions {
84
+ display : flex;
85
+ justify-content : flex-end;
84
86
align-self : flex-end;
85
- width : 100px ;
87
+ gap : 8px ;
88
+ }
89
+
90
+ .editor-actions button {
86
91
padding : 2px 4px ;
87
92
border-radius : 4px ;
93
+ width : 100px ;
88
94
}
89
95
90
96
.tests-result-container {
141
147
.challenge-main .tests-result-container {
142
148
width : 100% ;
143
149
}
150
+
151
+ .editor-actions {
152
+ width : 100% ;
153
+ }
144
154
}
145
155
146
156
.CodeMirror {
187
197
<!-- Code Editor Area -->
188
198
< div class ="codemirror-container ">
189
199
< div id ="editor "> </ div >
190
- < button id ="run-button ">
191
- ▶️ Run
192
- </ button >
200
+ < div class ="editor-actions ">
201
+ < button id ="reset-button " class ="secondary ">
202
+ Reset
203
+ </ button >
204
+ < button id ="run-button ">
205
+ ▶️ Run
206
+ </ button >
207
+ </ div >
193
208
</ div >
194
209
<!-- Test Cases and Result Area -->
195
210
< div class ="tests-result-container ">
258
273
} ) ;
259
274
} ;
260
275
276
+ let resetButton = document . getElementById ( 'reset-button' )
277
+ resetButton . onclick = function ( ) {
278
+ myCodeMirror . setValue ( code_under_test ) ;
279
+ } ;
280
+
261
281
// If window size is > 800, expand the challenge list.
262
282
function checkWidth ( ) {
263
283
let detailsElement = document . getElementById ( 'challenge-list' ) ;
You can’t perform that action at this time.
0 commit comments