Fossil

Check-in [dac9293b]
Login

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

Overview
Comment:Oops, fallen for testing built-in versus customized skin, fix the previous check-in.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | js-hamburger-menu
Files: files | file ages | folders
SHA3-256: dac9293b527b284aec0dde0ec4620ae74e438513be54bb1c5240284716596bb5
User & Date: florian 2019-01-02 07:24:00
Context
2019-01-02
15:31
Enhancements to the hamburger menu mechanism. check-in: 724a9b8f user: drh tags: trunk
07:24
Oops, fallen for testing built-in versus customized skin, fix the previous check-in. Closed-Leaf check-in: dac9293b user: florian tags: js-hamburger-menu
07:03
Less rigid string-to-number conversion for the custom "data-anim-ms" attribute. check-in: e4a18b67 user: florian tags: js-hamburger-menu
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to skins/default/js.txt.

37
38
39
40
41
42
43
44


45
46
47
48



49
50
51
52
53
54
55
  // We need this ugly calling form for old browsers that don't allow
  // panel.style.hasOwnProperty('transition'); catering to old browsers
  // is the whole point here.
  var animate = panel.style.transition !== null && (typeof(panel.style.transition) == "string");

  // The duration of the animation can be overridden from the default skin
  // header.txt by setting the "data-anim-ms" attribute of the panel.
  var animMS = parseInt(panel.getAttribute("data-anim-ms"));


  if (isNaN(animMS) || animMs == 0)
    animate = false;   // disable animation if non-numeric or zero
  else if (animMS < 0)
    animMS = 400;   // set default animation duration if negative




  // Calculate panel height despite its being hidden at call time.
  // Based on https://stackoverflow.com/a/29047447/142454
  var panelHeight;  // computed on first panel display
  function calculatePanelHeight() {

    // Clear the max-height CSS property in case the panel size is recalculated







|
>
>
|
|
|
|
>
>
>







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  // We need this ugly calling form for old browsers that don't allow
  // panel.style.hasOwnProperty('transition'); catering to old browsers
  // is the whole point here.
  var animate = panel.style.transition !== null && (typeof(panel.style.transition) == "string");

  // The duration of the animation can be overridden from the default skin
  // header.txt by setting the "data-anim-ms" attribute of the panel.
  var animMS = panel.getAttribute("data-anim-ms");
  if (animMS) {           // not null or empty string, parse it
    animMS = parseInt(animMS);
    if (isNaN(animMS) || animMS == 0)
      animate = false;    // disable animation if non-numeric or zero
    else if (animMS < 0)
      animMS = 400;       // set default animation duration if negative
  }
  else                    // attribute is null or empty string, use default
    animMS = 400;

  // Calculate panel height despite its being hidden at call time.
  // Based on https://stackoverflow.com/a/29047447/142454
  var panelHeight;  // computed on first panel display
  function calculatePanelHeight() {

    // Clear the max-height CSS property in case the panel size is recalculated