Commit 56d05519 authored by Florent Chehab's avatar Florent Chehab
Browse files

Tweaks

parent 17474d90
......@@ -6,6 +6,12 @@
text-align: left !important;
}
.rendered_html tr,
.rendered_html th,
.rendered_html td {
text-align: left !important;
}
.tg td {
font-size: 14px;
padding: 10px 5px;
......@@ -41,6 +47,7 @@
-webkit-appearance: none;
}
</style>
<script>
var table_header = function (content) {
return `
......@@ -96,9 +103,13 @@
<div class="styled-select">
Choix de l'UV :
<select id='UV-select' onchange="update_display(this.value);">
</select>
<form action="">
Choix de l'UV :
<select id='UV-select' onchange="update_display(this.value);">
</select>
<input id="UV-input-text" type="text">
<input type="button" value="Visualiser" onclick="update_display($('#UV-input-text').val())">
</form>
</div>
<br>
......@@ -300,4 +311,30 @@
update_display(all_uvs[0]);
}, 200);
$('#UV-input-text').keyup(function (event) {
var val = $('#UV-input-text').val().toUpperCase();
if (event.keyCode === 13) {
event.preventDefault();
for (ind in all_uvs) {
if (all_uvs[ind] == val) {
update_display(val);
}
}
} else {
var valid = false;
for (ind in all_uvs) {
var uv = all_uvs[ind];
var re = new RegExp('^' + val);
if (uv.match(re)) {
valid = true;
break;
}
}
if (!valid) {
val = val.substring(0, val.length - 1);
}
}
$('#UV-input-text').val(val);
});
</script>
\ No newline at end of file
......@@ -19,12 +19,12 @@
</style>
<script>
// Button to go to the uv detail section
if (document.getElementById('uv-details-name') === null) {
$('body').prepend("<a href='#'' class='got-to-uv'><center>Voir en détail l'UV<br><span id='uv-details-name' style='font-weight:bold;'></span></center></a>");
}
$('a.got-to-uv').fadeIn('slow');
$('a.got-to-uv').click(function () {
document.getElementById('UV-select').scrollIntoView();
return false;
});
</script>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment