0.0.293 add loader for buttons when form send
This commit is contained in:
@@ -1901,6 +1901,10 @@ button#edit_route {
|
||||
font-size: 13px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
#error_footer.hide{
|
||||
display: none;
|
||||
}
|
||||
#error_com_offer, #error_feedback{
|
||||
color: #ff0000;
|
||||
font-size: 14px;
|
||||
|
||||
1
static/img/svg/loader_white.svg
Normal file
1
static/img/svg/loader_white.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" width="32px" height="32px" viewBox="0 0 128 128" xml:space="preserve"><g><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="1"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.67" transform="rotate(45,64,64)"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.42" transform="rotate(90,64,64)"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.2" transform="rotate(135,64,64)"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.12" transform="rotate(180,64,64)"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.12" transform="rotate(225,64,64)"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.12" transform="rotate(270,64,64)"/><circle cx="16" cy="64" r="16" fill="#ffffff" fill-opacity="0.12" transform="rotate(315,64,64)"/><animateTransform attributeName="transform" type="rotate" values="0 64 64;315 64 64;270 64 64;225 64 64;180 64 64;135 64 64;90 64 64;45 64 64" calcMode="discrete" dur="720ms" repeatCount="indefinite"></animateTransform></g></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -205,13 +205,19 @@ function hideBlock(el) {
|
||||
let clear_form = document.getElementsByClassName('clear_form');
|
||||
clear_form[0].reset();
|
||||
|
||||
let clear_form_com = document.getElementsByClassName('commercial_offer');
|
||||
clear_form_com[0].reset();
|
||||
|
||||
|
||||
|
||||
let disable_btn = document.getElementById('send_feedback_form');
|
||||
// let disable_btn_f = document.getElementById('send_feedback_form');
|
||||
|
||||
if(disable_btn){
|
||||
disable_btn.removeAttribute('disabled');
|
||||
|
||||
}
|
||||
// disable_btn_f.removeAttribute('disabled');
|
||||
|
||||
|
||||
|
||||
let disable_btn_r = document.getElementById('request_btn');
|
||||
if(disable_btn_r){
|
||||
@@ -823,6 +829,9 @@ function checkDate() {
|
||||
|
||||
function RequestCommercialOffer (el){
|
||||
|
||||
el.style.background = '#FF613A url("/static/img/svg/loader_white.svg") no-repeat center';
|
||||
el.style.contentVisibility = 'hidden';
|
||||
|
||||
event.preventDefault()
|
||||
|
||||
let disable_btn = document.getElementById('send_feedback_form');
|
||||
@@ -863,9 +872,13 @@ function RequestCommercialOffer (el){
|
||||
data: formData,
|
||||
success: function(data){
|
||||
|
||||
if(el.id !== 'footer_input_button'){
|
||||
let insert_text = document.querySelector(".clear_form")
|
||||
// el.style.background = '#FF613A';
|
||||
el.removeAttribute('style')
|
||||
|
||||
|
||||
|
||||
if(el.id !== 'footer_input_button'){
|
||||
let insert_text = document.querySelector(".clear_form")
|
||||
if(insert_text){
|
||||
$(data.html).insertBefore(insert_text)
|
||||
}
|
||||
@@ -875,7 +888,19 @@ function RequestCommercialOffer (el){
|
||||
|
||||
$(data.html).insertBefore(insert_text_2)
|
||||
}
|
||||
} else {
|
||||
let disable_btn_f = document.getElementById('footer_input_button');
|
||||
disable_btn_f.removeAttribute('disabled');
|
||||
let clear_footer_form = document.getElementById('clear_input');
|
||||
|
||||
clear_footer_form.reset();
|
||||
|
||||
let hide_error_msg = document.getElementById('error_footer').classList.add('hide')
|
||||
}
|
||||
|
||||
|
||||
|
||||
clear_form_com[0].reset();
|
||||
},
|
||||
error: function (data, exception){
|
||||
// document.querySelector(".login").innerHTML = data.responseJSON.html
|
||||
|
||||
Reference in New Issue
Block a user