diff --git a/static/css/styles(boris).css b/static/css/styles(boris).css index 9cca590..a1f4710 100644 --- a/static/css/styles(boris).css +++ b/static/css/styles(boris).css @@ -167,7 +167,7 @@ .letrs-count.disabled{ /*color: #000000;*/ - background: rgb(241 241 241 / 30%); + /*background: rgb(241 241 241 / 30%);*/ color: #ff001a; } diff --git a/static/js/user_profile(boris).js b/static/js/user_profile(boris).js index 9204a52..e2801d6 100644 --- a/static/js/user_profile(boris).js +++ b/static/js/user_profile(boris).js @@ -23,17 +23,24 @@ function countLetters () { let count = area.value.length let ins_area = document.querySelector(".letrs-count-span") // let spans = document.querySelectorAll(".ins-span") + let count_div = ins_area.closest("div") if (count < 500) { let ins_area = document.querySelector(".letrs-count-span") ins_area.innerHTML = count + if (count_div.classList.contains("disabled")){ + count_div.classList.remove("disabled") + } } else { ins_area.innerHTML = '500' - // spans[0].classList.toggle("disabled") - // spans[1].classList.toggle("disabled") - area.setAttribute("disabled","disabled") - let count_div = ins_area.closest("div") - count_div.classList.toggle("disabled") + if (count_div.classList.contains("disabled")){ + // + } + else { + count_div.classList.add("disabled") + } + + } } diff --git a/templates/blocks/profile/b_create_ticket.html b/templates/blocks/profile/b_create_ticket.html index 24b2da4..083828d 100644 --- a/templates/blocks/profile/b_create_ticket.html +++ b/templates/blocks/profile/b_create_ticket.html @@ -33,7 +33,8 @@ placeholder="Введите сообщение..." value="{% if form.adding_machine.text %}{{ form.initial.text }}{% endif %}" onclick="countLetters()" - oninput="countLetters()"> + oninput="countLetters()" + maxlength="500"> {% if form.errors.text %}