Skip to content

Instantly share code, notes, and snippets.

@dislokacia
dislokacia / custom_loader.css
Created November 21, 2022 14:35
Custom Loader for JSF
/*For Elementor Pro User - in Custom CSS tab*/
/*In the custom spinner container widget Custom CSS field */
selector {
display:none;
}
selector i {
-webkit-animation: fa-spin 2s infinite linear;
animation: fa-spin 2s infinite linear;
}
@dislokacia
dislokacia / style.css
Created October 24, 2022 11:03
JetFB select2 as on the tutorial
.jet-form-builder .select2-container--default .select2-selection--single {
height: 50px!important;
padding: 10px!important;
}
.jet-form-builder .select2-container--default .select2-selection--single .select2-selection__arrow {
top: 25%;
}
.jet-form-builder .select2-container--default .select2-selection--single .select2-selection__arrow:after {
content: "";
position: absolute;
@dislokacia
dislokacia / script.js
Created July 29, 2022 09:26
mobile safari datetime for JFB
function addZeros(time) {
if (time < 10) {
time = "0" + time;
}
return time;
}
//select the datetime field
var dateInput = document.querySelectorAll('.jet-form-builder__field.datetime-field');
//get current date
var today = new Date();
@dislokacia
dislokacia / index.js
Created July 19, 2022 21:23
Accessible jet-pagination
jQuery(document).ready(function( $ ){
init();
$( document ).on( 'jet-filter-content-rendered', function() {
setTimeout(function() {
init();
$('.jet-filters-pagination__current .jet-filters-pagination__link').attr('aria-pressed', 'true');
}, 1);
});
function init(){
@dislokacia
dislokacia / script.js
Created July 7, 2022 21:05
JetSearch with empty input and checked category
jQuery(document).ready(function( $ ){
$('.jet-ajax-search__submit').on('click',function(){
$('.jet-ajax-search__form').submit();
})
$(".jet-ajax-search__submit").on('keyup', function (e) {
if (e.key === 'Enter' || e.keyCode === 13) {
$('.jet-ajax-search__form').submit();
}
});
});
@dislokacia
dislokacia / text_after_upload.js
Last active April 30, 2023 00:21
JetFormbuilder media field text after upload
jQuery(document).ready(function( $ ){
$('.jet-form-builder-file-upload__fields').each(function(index){
let upload = $(this).find('.jet-form-builder-file-upload__input');
$(this).append('<input type="button" class="addfile" value="Choose file"/>');
$(this).append('<label class="labeladdfile">Choose file</label></div>');
let labelAdd = $(this).find('.labeladdfile');
let buttonAdd = $(this).find('.addfile');
let uploadValue = $(this).find('.jet-form-builder-file-upload__files');
upload.css('display','none');
$(this).find('.addfile').click(function () {
@dislokacia
dislokacia / text_after_upload.js
Created July 1, 2022 08:06
JetEngine media field text after upload
jQuery(document).ready(function( $ ){
$('.jet-engine-file-upload__fields').each(function(index){
let upload = $(this).find('.jet-engine-file-upload__input');
$(this).append('<input type="button" class="addfile" value="Choose file"/>');
$(this).append('<label class="labeladdfile">Choose file</label></div>');
let labelAdd = $(this).find('.labeladdfile');
let buttonAdd = $(this).find('.addfile');
let uploadValue = $(this).find('.jet-engine-file-upload__value');
$(this).find('.jet-engine-file-upload__input').css('display','none');
$(this).find('.addfile').click(function () {
@dislokacia
dislokacia / Password visibility JetFormBuilder.js
Last active May 3, 2024 10:54
Password visibility JetFormBuilder
jQuery(document).ready(function( $ ){
$('.jet-form-builder input[type="password"]').each(function(){
let id = $(this).attr('id');
if($(this).length>0){
$(this).closest('div').append(`<label><input class="pass_vis" style="display:none;" type="checkbox" onclick="myFunction('${id}')"><i class="vis-icon fa fa-solid fa-eye"></i></label>`);
let offset = ($(this)[0].clientHeight - $('.vis-icon')[0].clientHeight)/2;
$(this).closest('div').css('position', 'relative');
$(this).siblings().css({
'position' : 'absolute',
'right' : '20px',
@dislokacia
dislokacia / Hide element, if there are no products in the cart (with Ajax events )
Created June 10, 2022 12:49
Hide element, if there are no products in the cart (with Ajax events )
jQuery(document).ready(function( $ ){
$( document ).ajaxComplete(function() {
if (!Cookies.get('woocommerce_items_in_cart')) {
$('.empty_message').show();
} else {
$('.empty_message').hide();
}
});
if (!Cookies.get('woocommerce_items_in_cart')) {
$('.empty_message').show();
@dislokacia
dislokacia / JetEngine macros to get the value of the Cookie by name
Last active June 10, 2022 13:06
JetEngine macros to get the value of the Cookie by name