Skip to content

Commit

Permalink
FIX test - clear timeout when carousel detached, remove fetch api dep…
Browse files Browse the repository at this point in the history
…endency in tests
  • Loading branch information
TomasKulhanek committed Sep 14, 2021
1 parent 00f7545 commit c76085b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/elements/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,11 @@ export class Carousel {
this.items[this.slideIndex].show = true;
if (this.infoarray.length > this.slideIndex) this.currentinfo = this.infoarray[this.slideIndex];
}

detached() {
if (this.timeoutvar) {
clearTimeout(this.timeoutvar);
this.timeoutvar = null;
}
}
}
3 changes: 1 addition & 2 deletions src/elements/markdownaurelia.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<require from="katex/dist/katex.css"></require>
<require from="./markdown.css"></require>
<require from="./tabs"></require>
<require from="./readdata"></require>
<require from="./carousel"></require>

<dynamic-html html.bind="html"></dynamic-html>
</template>

0 comments on commit c76085b

Please sign in to comment.