Skip to content

Instantly share code, notes, and snippets.

@Tusko
Created February 27, 2018 09:07
Show Gist options
  • Save Tusko/4168750ebbdf34fd2601b646932be008 to your computer and use it in GitHub Desktop.
Save Tusko/4168750ebbdf34fd2601b646932be008 to your computer and use it in GitHub Desktop.
woocommerce + selectrict.js
$(document).ajaxComplete(function(){
$('.selectric-wrapper').each(function () {
var t = $(this),
s = $('select', t),
Selectric = s.data('selectric');
if($('input.input-text', t).length > 0) {
$('input.input-text', t).clone().appendTo('#billing_state_field');
t.remove();
}
if(typeof Selectric !== 'undefined') {
Selectric.refresh();
}
});
$('select').each(function(){
var e = $(this);
if(e.data('selectric') !== 'undefined') {
e.selectric({
arrowButtonMarkup: '<i class="arrow_carrot-down"></i>',
maxHeight: (mob()?200:350),
disableOnMobile: false,
nativeOnMobile: false
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment