Skip to content

Commit

Permalink
Simplify code for copying to clipboard
Browse files Browse the repository at this point in the history
Honestly I don't understand the old code, but it breaks on fields with
applied transformations, while using simply text() works fine.

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Aug 2, 2017
1 parent 626c2b3 commit ef891b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,21 @@ AJAX.registerOnload('sql.js', function () {
textArea.value += '\n';

$('.notice,.success').each(function(){
textArea.value += $(this).clone().children().remove().end().text() + '\n\n';
textArea.value += $(this).text() + '\n\n';
});

$('.sql pre').each(function() {
textArea.value += $(this).text() + '\n\n';
});

$('.table_results .column_heading a').each(function() {
textArea.value += $(this).clone().children().remove().end().text() + '\t';
textArea.value += $(this).text() + '\t';
});

textArea.value += '\n';
$('.table_results tbody tr').each(function() {
$(this).find('.data span').each(function(){
textArea.value += $(this).clone().children().remove().end().text() + '\t';
textArea.value += $(this).text() + '\t';
});
textArea.value += '\n';
});
Expand Down

0 comments on commit ef891b2

Please sign in to comment.