Fossil

Check-in [ee074372]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Replaced the "hasOwnProperty" test for CSS transition support in the animated hamburger menu JS code with a better test that not only works on old IE but also on some truly ancient versions of SeaMonkey, Firefox, Chrome, etc.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ee074372e834aa71dc9b4f3ade369d45b908269d98c88b7da079ea3c04964947
User & Date: wyoung 2018-09-21 01:52:12
Context
2018-09-21
12:34
Back out the block-indentation CSS change from check-in [2190f86c324d0f57fa4f8]. check-in: eae0a982 user: drh tags: trunk
01:52
Replaced the "hasOwnProperty" test for CSS transition support in the animated hamburger menu JS code with a better test that not only works on old IE but also on some truly ancient versions of SeaMonkey, Firefox, Chrome, etc. check-in: ee074372 user: wyoung tags: trunk
2018-09-20
15:55
Updates to the change log for the upcoming 2.7 release. check-in: 450e8723 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to skins/default/js.txt.

    16     16   ** This file contains the JS code specific to the Fossil default skin.
    17     17   ** Currently, the only thing this does is handle clicks on its hamburger
    18     18   ** menu button.
    19     19   */
    20     20   (function() {
    21     21     var panel = document.getElementById("hbdrop");
    22     22     if (!panel) return;   // site admin might've nuked it
           23  +  if (!panel.style) return;  // shouldn't happen, but be sure
    23     24     var panelBorder = panel.style.border;
    24     25   
    25     26     // Disable animation if this browser doesn't support CSS transitions.
    26     27     //
    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');
           28  +  // We need this ugly calling form for old browsers that don't allow
           29  +  // panel.style.hasOwnProperty('transition'); catering to old browsers
           30  +  // is the whole point here.
           31  +  var animate = panel.style.transition !== null && (typeof(panel.style.transition) == "string");
    33     32     var animMS = 400;
    34     33   
    35     34     // Calculate panel height despite its being hidden at call time.
    36     35     // Based on https://stackoverflow.com/a/29047447/142454
    37     36     var panelHeight;  // computed on sitemap load
    38     37     function calculatePanelHeight() {
    39     38       // Get initial panel styles so we can restore them below.