Skip to content

Instantly share code, notes, and snippets.

@ryanhs
Last active August 29, 2015 14:17
Show Gist options
  • Save ryanhs/e7a57bf13eab825b0d7a to your computer and use it in GitHub Desktop.
Save ryanhs/e7a57bf13eab825b0d7a to your computer and use it in GitHub Desktop.
PS auto translate -_-
$('div[name="modules_div"]').each(function(){
id = $(this).attr('id')
$('#' + id + ' table tbody').children().each(function(k, v){
i = 0;
text = '';
$(this).children().each(function(){
if(i == 0){
text = $(this).text()
}
i++;
})
c = k + 1;
var input = $('#' + id + ' table tbody tr:nth-child(' + c + ') td input');
if(input.length > 0) if(input.val() == '') input.val(text);
textarea = $('#' + id + ' table tbody tr:nth-child(' + c + ') td textarea');
if(textarea.length > 0) if(textarea.val() == '') textarea.val(text);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment