From 325acd35807f16c7fe816db6609049920e2e4b18 Mon Sep 17 00:00:00 2001 From: ArtemB Date: Tue, 5 Dec 2023 14:38:25 +0300 Subject: [PATCH] 0.0.311 add red color for changed input in from_to_addres_point --- static/css/styles.css | 8 ++++++++ static/js/user_profile.js | 13 ++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/static/css/styles.css b/static/css/styles.css index f41fd8b..8a00799 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -646,6 +646,14 @@ header .header-second { aspect-ratio: 4/3; } +.from_address_point_txt.red_text{ + color: #ff0000; +} +.to_address_point_txt.red_text{ + color: #ff0000; + +} + .header-second-item, .cont_header_btn_profile, diff --git a/static/js/user_profile.js b/static/js/user_profile.js index f534219..5f465ca 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -351,6 +351,10 @@ function selectItemAddrPoint(id, name, ctrl_name,){ tap_txt_cont.setAttribute('title',name) let tap_cont = document.querySelector("#id_" + ctrl_name.slice(0, -4)); tap_cont.value = id; + if (tap_txt_cont.classList.contains('red_text')){ + tap_txt_cont.classList.remove('red_text') + } + if (!window.location.href.includes("profile")){ changeWidthEL(tap_txt_cont) } @@ -413,17 +417,16 @@ function onblurInputField(event,el){ function clearID(el) { - el.select(); - if(el.id === 'id_from_address_point_txt'){ + if(el.value !== "" && el.id === 'id_from_address_point_txt' ){ document.getElementById('id_from_address_point').value = '' - } else if(el.id === 'id_to_address_point_txt'){ + el.classList.add('red_text') + } else if(el.value !== "" && el.id === 'id_to_address_point_txt'){ document.getElementById('id_to_address_point').value = '' + el.classList.add('red_text') } - - }