FAR HTML : by Helpware‎ > ‎Bugs‎ > ‎

WebHelp Node Disappears

Problem: 

FAR Uncompressed Help -- AKA. FAR WebHelp 
When Chrome Browser version "Version 45.0.2454.85 m" was released (I'm running Windows 10 64bit), 
when you click a TOC node [-] to contract a section the node text disappears.
Uncompressed Help Example:  http://helpware.net/FAR/help/hh_start.htm

Resolution

The JavaScript has been stable for many years (over a decade). 
The problem has been reported to Google. We will implement a work around (see below) if Google don't fix Chrome in a timely manner.

Workaround 

The following fix is a workaround
1. Search for file "tree.js" in your help (FAR Uncompressed Help adds this to your help).
2. Find "function expandCollapse(el)"
3. At the end of function add the line el.innerHTML = el.innerHTML; 
   This will force a refresh and redraw the text correctly.

Note: To make the fix in FAR install code (so future generations contain the fix) update the file 
C:\Program Files (x86)\Helpware\FAR\extra\tree.js

function expandCollapse(el)
{
//If source treeNode has child nodes, expand or collapse view of treeNode
//
    if (el == null)
        return; //Do nothing if it isn't a treeNode

   var child;
   var imgEl;
   for(var i=0; i < el.childNodes.length; i++)
    {
        child = el.childNodes[i];
        if (child.src)
        {
            imgEl = child;
        }
        else if (child.className == "treeSubnodesHidden")
        {
            child.className = "treeSubnodes";
            imgEl.src = "treenodeminus.gif";
            break;
        }
        else if (child.className == "treeSubnodes")
        {
            child.className = "treeSubnodesHidden";
            imgEl.src = "treenodeplus.gif";
            break;
        }
    }
    
    //!!! fix for node text disappearing on contract click - 9/8/2015 -- Broken by Chrome Version 45.0.2454.85 m
    el.innerHTML = el.innerHTML;  // force refresh 
}


Comments