Fossil SCM
Fixed the panel.style.hasOwnProperty() test in the default skin's js.txt so that it will work on IE8 and below. See code comment for rationale.
Commit
e54095f9af464436c1c83c0db6bd21b8beb4743a197adb5edb39e63e6671b562
Parent
2804c71a43df0cd…
1 file changed
+9
-1
+9
-1
| --- skins/default/js.txt | ||
| +++ skins/default/js.txt | ||
| @@ -19,11 +19,19 @@ | ||
| 19 | 19 | */ |
| 20 | 20 | (function() { |
| 21 | 21 | var panel = document.getElementById("hbdrop"); |
| 22 | 22 | if (!panel) return; // site admin might've nuked it |
| 23 | 23 | var panelBorder = panel.style.border; |
| 24 | - var animate = panel.style.hasOwnProperty('transition'); | |
| 24 | + | |
| 25 | + // Disable animation if this browser doesn't support CSS transitions. | |
| 26 | + // | |
| 27 | + // We need this ugly calling form for IE < 9 since it doesn't give you | |
| 28 | + // a true Object for host-provided values such as 'panel'. That is, | |
| 29 | + // panel.style.hasOwnProperty() doesn't exist on IE8! Since the whole | |
| 30 | + // point of this test is to allow the code below to run without a JS | |
| 31 | + // error on deficient browsers, we can't just ignore this problem. | |
| 32 | + var animate = Object.prototype.hasOwnProperty.call(panel.style, 'transition'); | |
| 25 | 33 | var animMS = 400; |
| 26 | 34 | |
| 27 | 35 | // Calculate panel height despite its being hidden at call time. |
| 28 | 36 | // Based on https://stackoverflow.com/a/29047447/142454 |
| 29 | 37 | var panelHeight; // computed on sitemap load |
| 30 | 38 |
| --- skins/default/js.txt | |
| +++ skins/default/js.txt | |
| @@ -19,11 +19,19 @@ | |
| 19 | */ |
| 20 | (function() { |
| 21 | var panel = document.getElementById("hbdrop"); |
| 22 | if (!panel) return; // site admin might've nuked it |
| 23 | var panelBorder = panel.style.border; |
| 24 | var animate = panel.style.hasOwnProperty('transition'); |
| 25 | var animMS = 400; |
| 26 | |
| 27 | // Calculate panel height despite its being hidden at call time. |
| 28 | // Based on https://stackoverflow.com/a/29047447/142454 |
| 29 | var panelHeight; // computed on sitemap load |
| 30 |
| --- skins/default/js.txt | |
| +++ skins/default/js.txt | |
| @@ -19,11 +19,19 @@ | |
| 19 | */ |
| 20 | (function() { |
| 21 | var panel = document.getElementById("hbdrop"); |
| 22 | if (!panel) return; // site admin might've nuked it |
| 23 | var panelBorder = panel.style.border; |
| 24 | |
| 25 | // Disable animation if this browser doesn't support CSS transitions. |
| 26 | // |
| 27 | // We need this ugly calling form for IE < 9 since it doesn't give you |
| 28 | // a true Object for host-provided values such as 'panel'. That is, |
| 29 | // panel.style.hasOwnProperty() doesn't exist on IE8! Since the whole |
| 30 | // point of this test is to allow the code below to run without a JS |
| 31 | // error on deficient browsers, we can't just ignore this problem. |
| 32 | var animate = Object.prototype.hasOwnProperty.call(panel.style, 'transition'); |
| 33 | var animMS = 400; |
| 34 | |
| 35 | // Calculate panel height despite its being hidden at call time. |
| 36 | // Based on https://stackoverflow.com/a/29047447/142454 |
| 37 | var panelHeight; // computed on sitemap load |
| 38 |