fix chat file button

master
Aevann 2023-10-05 15:40:03 +03:00
parent 6368ad7e9a
commit 904d41230f
3 changed files with 6 additions and 3 deletions

View File

@ -185,6 +185,6 @@ h1, h2, h3, h4, h5, h6 {
}
}
#shrink .format * {
#shrink .format .fas {
font-size: 1.3rem !important;
}

View File

@ -149,8 +149,10 @@ function send() {
document.getElementById('quotes_id').value = null;
oldfiles[ta.id] = new DataTransfer();
input.value = null;
input.previousElementSibling.innerHTML = '<i class="fas fa-image" style="font-size:1.3rem!important"></i>'
input.previousElementSibling.className = "fas fa-image";
input.previousElementSibling.textContent = "";
box.scrollTo(0, box.scrollHeight);
setTimeout(function () {
box.scrollTo(0, box.scrollHeight)
@ -301,6 +303,7 @@ const input = document.getElementById('file')
function handle_files() {
if (!input.files.length) return
const char_limit = screen_width >= 768 ? 50 : 5;
input.previousElementSibling.className = "";
input.previousElementSibling.textContent = input.files[0].name.substr(0, char_limit);
}

View File

@ -120,7 +120,7 @@
{% macro file_btn(input_id, disabled, image_only) %}
<label class="btn btn-secondary format m-0" for="{{input_id}}" {% if g.is_tor or disabled %}disabled{% endif %}>
<i class="fas fa-{% if image_only %}image{% else %}file{% endif %}"></i>
<span class="fas fa-{% if image_only %}image{% else %}file{% endif %}"></span>
<input autocomplete="off" id="{{input_id}}" accept="image/*{% if not image_only %}, video/*, audio/*{% endif %}" type="file" multiple="multiple" name="file" {% if g.is_tor or disabled %}disabled{% endif %} hidden>
</label>
{% endmacro %}