Skip to content

Commit 71367df

Browse files
restricting selection of other algorithms.
1 parent e8904e2 commit 71367df

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

index.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
<select id="selected-algorithm" onchange="changeInSelectedAlgorithm(value)">
5555
<option value="linear-search">Linear Search</option>
5656
<option value="binary-search">Binary Search</option>
57+
<option value="selection-sort">Selection Sort</option>
58+
<option value="bubble-sort">Bubble Sort</option>
5759
</select>
5860
</div>
5961

@@ -102,7 +104,12 @@
102104
}
103105

104106
function changeInSelectedAlgorithm(value){
105-
appendSelectedArraySizeElement(getArraySize())
107+
if(value !== 'selection-sort' && value !== 'bubble-sort'){
108+
appendSelectedArraySizeElement(getArraySize())
109+
} else {
110+
alert('Selected algorithm will be available soon :)')
111+
document.getElementById("selected-algorithm").value = "linear-search"
112+
}
106113
}
107114

108115
function enableUserPreference(){

0 commit comments

Comments
 (0)