@@ -296,6 +296,8 @@ function submitGivens() {
296
296
297
297
if ( currentCell . value !== 0 ) {
298
298
currentCell . element . innerHTML = currentCell . value ;
299
+ } else {
300
+ currentCell . element . classList . add ( "blank_cell_highlight_black" ) ;
299
301
}
300
302
301
303
currentCell . solution = parseInt ( cells . solution [ i ] ) ;
@@ -376,14 +378,13 @@ function setBlankCells(color) {
376
378
currentCell = cells [ i ] ;
377
379
378
380
if ( currentCell . value === 0 ) {
381
+ currentCell . element . classList . remove ( "blank_cell_highlight_black" ) ;
379
382
currentCell . element . classList . remove ( "blank_cell_highlight_red" ) ;
380
383
currentCell . element . classList . remove ( "blank_cell_highlight_blue" ) ;
381
384
currentCell . element . classList . remove ( "blank_cell_highlight_green" ) ;
382
385
currentCell . element . classList . remove ( "blank_cell_highlight_purple" ) ;
383
386
384
- if ( color !== "black" ) {
385
- currentCell . element . classList . add ( "blank_cell_highlight_" + color ) ;
386
- }
387
+ currentCell . element . classList . add ( "blank_cell_highlight_" + color ) ;
387
388
}
388
389
389
390
}
@@ -395,7 +396,7 @@ function deleteColoredCells(element) {
395
396
var color = element . value . toLowerCase ( ) ;
396
397
element . value = "Select Color" ;
397
398
398
- if ( color === "select color" || ! confirm ( "Are you sure you want to delete all cells marked " + color + "?" ) ) {
399
+ if ( color === "select color" || ! confirm ( "Are you sure you want to delete all cells marked " + color + "?" ) ) {
399
400
return ;
400
401
}
401
402
@@ -404,8 +405,9 @@ function deleteColoredCells(element) {
404
405
for ( var i = 0 ; i < 81 ; i ++ ) {
405
406
currentCell = cells [ i ] ;
406
407
407
- if ( currentCell . value !== 0 )
408
- console . log ( currentCell . element . classList . contains ( "blank_cell_highlight_" + color ) ) ;
408
+ // if (currentCell.value !== 0) {
409
+ // console.log(currentCell.element.classList.contains("blank_cell_highlight_" + color));
410
+ // }
409
411
410
412
if ( currentCell . value !== 0 && currentCell . element . classList . contains ( "blank_cell_highlight_" + color ) ) {
411
413
currentCell . element . firstChild . value = "" ;
@@ -414,9 +416,7 @@ function deleteColoredCells(element) {
414
416
415
417
currentCell . element . classList . remove ( "blank_cell_highlight_" + color ) ;
416
418
417
- if ( color !== "black" ) {
418
- currentCell . element . classList . add ( "blank_cell_highlight_" + cells . blankCellColor ) ;
419
- }
419
+ currentCell . element . classList . add ( "blank_cell_highlight_" + cells . blankCellColor ) ;
420
420
}
421
421
}
422
422
0 commit comments