Skip to content

Commit 40b0465

Browse files
committed
Keep input elements in options disabled until initialized
1 parent 1829b84 commit 40b0465

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

extension/options/js/options.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ function setInitialState() {
2727
document.getElementById('exclude_duplicate_questions').checked = items.excludeDuplicateQuestionsFilter;
2828
document.getElementById('answer_type').options.selectedIndex = items.answerTypeFilter;
2929
document.getElementById('custom_filter').value = items.customFilter;
30+
31+
$(":input").attr('disabled', false);
3032
});
3133
}
3234

extension/options/options.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
</legend>
2929
<div class="col-sm-12">
3030
<div class="form-check save_tab_result">
31-
<input class="form-check-input" type="radio" name="tab_result" id="same_tab_result" value="same_tab_result" checked>
31+
<input class="form-check-input" type="radio" name="tab_result" id="same_tab_result" value="same_tab_result" checked disabled>
3232
<label class="form-check-label" for="same_tab_result">
3333
same tab
3434
</label>
3535
</div>
3636
<div class="form-check save_tab_result">
37-
<input class="form-check-input" type="radio" name="tab_result" id="new_tab_result" value="new_tab_result">
37+
<input class="form-check-input" type="radio" name="tab_result" id="new_tab_result" value="new_tab_result" disabled>
3838
<label class="form-check-label" for="new_tab_result">
3939
new tab
4040
</label>
@@ -53,24 +53,24 @@
5353

5454
<div class="form-check">
5555
<label class="form-check-label">
56-
<input class="form-check-input" type="checkbox" name="question_with_code" id="question_with_code">
56+
<input class="form-check-input" type="checkbox" name="question_with_code" id="question_with_code" disabled>
5757
Questions that contain code
5858
</label>
5959
</div>
6060
<div class="form-check">
6161
<label class="form-check-label">
62-
<input class="form-check-input" type="checkbox" name="community_wikis" id="community_wikis">
62+
<input class="form-check-input" type="checkbox" name="community_wikis" id="community_wikis" disabled>
6363
Community wiki posts (<a href="https://meta.stackexchange.com/questions/11740/what-are-community-wiki-posts" target="_blank">reference</a>)
6464
</label>
6565
</div>
6666
<div class="form-check">
6767
<label class="form-check-label">
68-
<input class="form-check-input" type="checkbox" name="exclude_duplicate_questions" id="exclude_duplicate_questions">
68+
<input class="form-check-input" type="checkbox" name="exclude_duplicate_questions" id="exclude_duplicate_questions" disabled>
6969
Exclude duplicate questions
7070
</label>
7171
</div>
7272
<div class="form-group" style="margin-top: 0.5rem;">
73-
<select class="form-control" name="answer_type" id="answer_type">
73+
<select class="form-control" name="answer_type" id="answer_type" disabled>
7474
<option value="0">All questions</option>
7575
<option value="1">Questions with answers</option>
7676
<option value="2">Questions with accepted answers</option>
@@ -80,7 +80,7 @@
8080

8181
<div class="form-group" style="margin-top: 0.5rem;">
8282
<label for="custom_filter"><u>Add custom filters</u>:</label> (<a href="https://stackoverflow.com/help/searching" target="_blank">filters reference</a>)
83-
<input type="text" class="form-control" name="custom_filter" id="custom_filter">
83+
<input type="text" class="form-control" name="custom_filter" id="custom_filter" disabled>
8484
</div>
8585

8686
</div>

0 commit comments

Comments
 (0)