Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
(function ($) {
'use strict';
function change_avatar_div( e ){
var field = $(e.currentTarget);
var acw_avatar_div = field.closest('.acw-thumb-size-wrap').find('.acw-avatar');
if( acw_avatar_div.length ) {
var icon = $( '.acw-icon', acw_avatar_div);
var size = parseInt ( ($.trim( field.val() ) * 1) + 0 );
acw_avatar_div.css({
'height' : size + 'px',
'width' : size + 'px'
});
icon.css({ 'font-size' : size + 'px' });
}
return;
};
$('#wpcontent').on( 'change', '.acw-thumb-size', function ( e ) {
change_avatar_div( e );
return;
});
$('#wpcontent').on( 'keyup', '.acw-thumb-size', function ( e ) {
setTimeout( function(){
change_avatar_div( e );
}, 300 );
return;
});
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment