From 115e2eff8b16449363a7e552ce60d9804eb273f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leo=20La=CC=88nnenma=CC=88ki?= Date: Mon, 21 Nov 2011 08:14:57 +0200 Subject: [PATCH] Clone elements before appending them to the temporary div that is used for logging. --- spec/jasmine/console_log/console_log_spec.js | 6 +++--- vendor/assets/coffeescripts/prolog.coffee | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/jasmine/console_log/console_log_spec.js b/spec/jasmine/console_log/console_log_spec.js index 90b4a26..b31345b 100644 --- a/spec/jasmine/console_log/console_log_spec.js +++ b/spec/jasmine/console_log/console_log_spec.js @@ -6,9 +6,9 @@ describe('console.log', function() { it("wont eat my precious jqueries", function() { var d = $('
b
'); - expect(d.find('#inner').length).toBe(1); - console.log(d.find('#inner')); - expect(d.find('#inner').length).toBe(1); + expect(d.find('#inner').length).toBe(1); + console.log(d.find('#inner')); + expect(d.find('#inner').length).toBe(1); }); }); diff --git a/vendor/assets/coffeescripts/prolog.coffee b/vendor/assets/coffeescripts/prolog.coffee index 75479c9..09fbcf7 100644 --- a/vendor/assets/coffeescripts/prolog.coffee +++ b/vendor/assets/coffeescripts/prolog.coffee @@ -2,7 +2,7 @@ if window.JHW window.console = log: (data) -> if typeof(jQuery) != 'undefined' && data instanceof jQuery - JHW.log(style_html($("
").append(data).html(), { indent_size: 2 })) + JHW.log(style_html($("
").append(data.clone()).html(), { indent_size: 2 })) else useJsDump = true