narrowcasting: fix check for correct variable animateclass - jscancer - Javascript crap (relatively small)
(HTM) git clone git://git.codemadness.org/jscancer
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 2eb5ad4110cabfa6ebd65a0e631a7c1c49901d48
(DIR) parent db8eeb55c0f54f14a83bf10b4276c8063bd491dc
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 10 Oct 2025 11:28:37 +0200
narrowcasting: fix check for correct variable animateclass
When the attribute was not set it would also set "null".
Diffstat:
M narrowcasting/script.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/narrowcasting/script.js b/narrowcasting/script.js
@@ -200,7 +200,7 @@ for (var i = 0; i < xhrcontentels.length; i++) {
// add nodes to force a transition.
var node = document.createElement("div");
node.innerHTML = newcontent;
- if (config.animate !== "") {
+ if (config.animateclass !== "") {
node.classList.add("animate-once");
node.classList.add(config.animateclass);
}
@@ -218,7 +218,7 @@ for (var i = 0; i < xhrcontentels.length; i++) {
// config / context.
var config = {
- animateclass: bindel.getAttribute("data-animate-class"),
+ animateclass: bindel.getAttribute("data-animate-class") || "",
el: bindel,
processfn: processfn,
timeout: parseInt(bindel.getAttribute("data-timeout")) || 10000, // default: 10 seconds