Fossil SCM
Less rigid string-to-number conversion for the custom "data-anim-ms" attribute.
Commit
e4a18b67028e3c357955082b6520668c2cfbcf50e82f1384fc535a5f90a79b9a
Parent
bf8946a138564db…
1 file changed
+5
-5
+5
-5
| --- skins/default/js.txt | ||
| +++ skins/default/js.txt | ||
| @@ -39,15 +39,15 @@ | ||
| 39 | 39 | // is the whole point here. |
| 40 | 40 | var animate = panel.style.transition !== null && (typeof(panel.style.transition) == "string"); |
| 41 | 41 | |
| 42 | 42 | // The duration of the animation can be overridden from the default skin |
| 43 | 43 | // header.txt by setting the "data-anim-ms" attribute of the panel. |
| 44 | - var animMS = panel.getAttribute("data-anim-ms"); | |
| 45 | - if (animMS === "0") | |
| 46 | - animate = false; // disable animation if "data-anim-ms" === "0" | |
| 47 | - else if (!animMS || animMS>>0 !== Number(animMS) || animMS < 0) | |
| 48 | - animMS = 400; // set default if missing, empty, non-integer, or negative | |
| 44 | + var animMS = parseInt(panel.getAttribute("data-anim-ms")); | |
| 45 | + if (isNaN(animMS) || animMs == 0) | |
| 46 | + animate = false; // disable animation if non-numeric or zero | |
| 47 | + else if (animMS < 0) | |
| 48 | + animMS = 400; // set default animation duration if negative | |
| 49 | 49 | |
| 50 | 50 | // Calculate panel height despite its being hidden at call time. |
| 51 | 51 | // Based on https://stackoverflow.com/a/29047447/142454 |
| 52 | 52 | var panelHeight; // computed on first panel display |
| 53 | 53 | function calculatePanelHeight() { |
| 54 | 54 |
| --- skins/default/js.txt | |
| +++ skins/default/js.txt | |
| @@ -39,15 +39,15 @@ | |
| 39 | // is the whole point here. |
| 40 | var animate = panel.style.transition !== null && (typeof(panel.style.transition) == "string"); |
| 41 | |
| 42 | // The duration of the animation can be overridden from the default skin |
| 43 | // header.txt by setting the "data-anim-ms" attribute of the panel. |
| 44 | var animMS = panel.getAttribute("data-anim-ms"); |
| 45 | if (animMS === "0") |
| 46 | animate = false; // disable animation if "data-anim-ms" === "0" |
| 47 | else if (!animMS || animMS>>0 !== Number(animMS) || animMS < 0) |
| 48 | animMS = 400; // set default if missing, empty, non-integer, or negative |
| 49 | |
| 50 | // Calculate panel height despite its being hidden at call time. |
| 51 | // Based on https://stackoverflow.com/a/29047447/142454 |
| 52 | var panelHeight; // computed on first panel display |
| 53 | function calculatePanelHeight() { |
| 54 |
| --- skins/default/js.txt | |
| +++ skins/default/js.txt | |
| @@ -39,15 +39,15 @@ | |
| 39 | // is the whole point here. |
| 40 | var animate = panel.style.transition !== null && (typeof(panel.style.transition) == "string"); |
| 41 | |
| 42 | // The duration of the animation can be overridden from the default skin |
| 43 | // header.txt by setting the "data-anim-ms" attribute of the panel. |
| 44 | var animMS = parseInt(panel.getAttribute("data-anim-ms")); |
| 45 | if (isNaN(animMS) || animMs == 0) |
| 46 | animate = false; // disable animation if non-numeric or zero |
| 47 | else if (animMS < 0) |
| 48 | animMS = 400; // set default animation duration if negative |
| 49 | |
| 50 | // Calculate panel height despite its being hidden at call time. |
| 51 | // Based on https://stackoverflow.com/a/29047447/142454 |
| 52 | var panelHeight; // computed on first panel display |
| 53 | function calculatePanelHeight() { |
| 54 |