-
-
Save ryanhs/e7a57bf13eab825b0d7a to your computer and use it in GitHub Desktop.
PS auto translate -_-
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
$('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