forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathipr-search.js
More file actions
43 lines (39 loc) · 1.35 KB
/
ipr-search.js
File metadata and controls
43 lines (39 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$(document)
.ready(function () {
// hack the "All States" check box
$("#id_state .form-check")
.addClass("form-check-inline");
$("#id_state input[value!=all]")
.on("change", function (e) {
if (this.checked) {
$("#id_state input[value=all]")
.prop('checked', false);
}
});
$("#id_state_0")
.on("change", function (e) {
if (this.checked) {
$("#id_state input[value!=all]")
.prop('checked', false);
}
});
$("form.ipr-search button[type=submit]")
.on("click", function (e) {
const value = $(e.target)
.attr("value");
$("form.ipr-search input[name=submit]")
.attr("value", value);
});
// make enter presses submit through the nearby button
$("form.ipr-search input")
.on("keydown", function (e) {
if (e.key != "Enter") {
return;
}
e.preventDefault();
$(this)
.closest(".input-group")
.find('button[type=submit]')
.trigger("click");
});
});