forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathipr-search.js
More file actions
37 lines (34 loc) · 1.17 KB
/
ipr-search.js
File metadata and controls
37 lines (34 loc) · 1.17 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
$(document)
.ready(function () {
// hack the "All States" check box
$("#id_state")
.addClass("list-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);
}
});
// make enter presses submit through the nearby button
// FIXME: this seems to be broken
$("form.ipr-search input,select")
.on("keyup", function (e) {
var submitButton = $(this)
.closest(".mb-3")
.find('button[type=submit]');
if (e.which == 13 && submitButton.length > 0) {
submitButton.trigger("click");
return false;
} else {
return true;
}
});
});