automatically insert only candidate on click
This commit is contained in:
parent
b20c6b72bd
commit
c09d51555d
12
sudoku.js
12
sudoku.js
@ -110,11 +110,19 @@ function onfocus() {
|
||||
}
|
||||
|
||||
function onclick() {
|
||||
if (inkPenRadio.checked) {
|
||||
if (this.value == "" && this.candidates.size == 1) {
|
||||
valueToInsert = this.candidates.values().next().value
|
||||
document.getElementById("insertRadio" + valueToInsert).checked = true
|
||||
this.value = valueToInsert
|
||||
} else if (inkPenRadio.checked) {
|
||||
if (valueToInsert)
|
||||
this.value = valueToInsert
|
||||
else
|
||||
this.select()
|
||||
} else if (pencilRadio.checked) {
|
||||
if (valueToInsert)
|
||||
this.value += valueToInsert
|
||||
} else {
|
||||
} else if (eraserRadio.checked) {
|
||||
this.value = ""
|
||||
this.placeholder = ""
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user