Created
March 15, 2016 01:46
-
-
Save dboutote/a2fae8f21d26821aae8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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