-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathscript.js
More file actions
52 lines (46 loc) · 1.59 KB
/
Copy pathscript.js
File metadata and controls
52 lines (46 loc) · 1.59 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
44
45
46
47
48
49
50
51
52
$(document).ready(function() {
$("#dataTable").DataTable({
select: true,
colReorder: true,
searchPanes: {
cascadePanes: true
},
columnDefs: [{
searchPanes: {
show: true
},
targets: [0, 1, 2, 3, 5]
}],
dom: 'rtpP'
});
// Dynamic size for selects
// Get select with most options
let maxSize = 15;
$(".container select").each(function() {
let size = $(this).children().length;
if (size >= maxSize) {
maxSize = size;
}
$(this).attr("size", size);
})
// Set size to all selects
$(".container select").each(function() {
$(this).attr("size", maxSize);
})
$("#addLaptimeForm").submit(function(event) {
event.preventDefault();
let game = $("#selectGame").val();
let car = $("#selectCar").val();
let track = $("#selectTrack").val();
let transmission = $("#selectTransmission").val();
let time = $("#inputTime").val();
$(`<form action="addData.php" method="POST">
<input type="hidden" name="add-type" value="laptime">
<input type="hidden" name="track" value="` + track + `">
<input type="hidden" name="game" value="` + game + `">
<input type="hidden" name="car" value="` + car + `">
<input type="hidden" name="transmission" value="` + transmission + `">
<input type="hidden" name="time" value="` + time + `">
</form>`).appendTo('body').submit();
})
})