gitflow-hotfix-stash: fix_inputs_forcesync

This commit is contained in:
ostertun
2020-10-15 14:03:17 +02:00
parent de5abcdfaf
commit da48e79a36
3 changed files with 29 additions and 4 deletions

View File

@@ -346,6 +346,31 @@ eraseCookie('sticky_dark_mode');
}
})
log('[tpl] Init inputs');
$('.input-required input, .input-required select, .input-required textarea').on('focusin keyup',function(){
var spanValue = $(this).parent().find('span').text();
if($(this).val() != spanValue && $(this).val() != ""){
$(this).parent().find('span').addClass('input-style-1-active').removeClass('input-style-1-inactive');
}
if($(this).val() === ""){
$(this).parent().find('span').removeClass('input-style-1-inactive input-style-1-active');
}
});
$('.input-required input, .input-required select, .input-required textarea').on('focusout',function(){
var spanValue = $(this).parent().find('span').text();
if($(this).val() === ""){
$(this).parent().find('span').removeClass('input-style-1-inactive input-style-1-active');
}
$(this).parent().find('span').addClass('input-style-1-inactive')
});
$('.input-required select').on('focusout',function(){
var getValue = $(this)[0].value;
if(getValue === "default"){
$(this).parent().find('span').removeClass('input-style-1-inactive input-style-1-active');
}
});
log('[tpl] init a2h');
//Adding added-to-homescreen class to be targeted when used as PWA.