diff --git a/client/js/templating.js b/client/js/templating.js index f796d63a2..d2a493aac 100644 --- a/client/js/templating.js +++ b/client/js/templating.js @@ -650,6 +650,7 @@ qq.Templating = function(spec) { }, reset: function() { + container.innerHTML = ""; this.render(); }, diff --git a/test/unit/templating.js b/test/unit/templating.js index 0051bff13..4475997b1 100644 --- a/test/unit/templating.js +++ b/test/unit/templating.js @@ -328,6 +328,11 @@ describe("templating.js", function() { assert.ok(!$fixture.find(".qq-upload-pause-selector").hasClass(HIDE_CSS)); assert.ok(!$fixture.find(".qq-upload-spinner-selector").hasClass(HIDE_CSS)); }); + + it("reset clears contents before appending new render", function() { + templating.reset(); + assert.equal($fixture.find(".qq-uploader").length, 1); + }); }); describe("permanently hidden files tests", function() {