Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

fix(templating.js): reset caused duplicate template contents (#1945) #1958

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/js/templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ qq.Templating = function(spec) {
},

reset: function() {
container.innerHTML = "";
this.render();
},

Expand Down
5 changes: 5 additions & 0 deletions test/unit/templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down