automatically insert only candidate on click
This commit is contained in:
parent
b20c6b72bd
commit
c09d51555d
14
sudoku.js
14
sudoku.js
@ -110,11 +110,19 @@ function onfocus() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onclick() {
|
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
|
this.value = valueToInsert
|
||||||
|
} else if (inkPenRadio.checked) {
|
||||||
|
if (valueToInsert)
|
||||||
|
this.value = valueToInsert
|
||||||
|
else
|
||||||
|
this.select()
|
||||||
} else if (pencilRadio.checked) {
|
} else if (pencilRadio.checked) {
|
||||||
this.value += valueToInsert
|
if (valueToInsert)
|
||||||
} else {
|
this.value += valueToInsert
|
||||||
|
} else if (eraserRadio.checked) {
|
||||||
this.value = ""
|
this.value = ""
|
||||||
this.placeholder = ""
|
this.placeholder = ""
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user