Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Hidedelay on hover

    It would be useful to allow a hidedelay on the hovercomponent. This will allow the user to select/click a hovercomponent (like a link to external documentation).

    This is a dirty hack to allow this:
    Code:
    isc.Hover.addClassMethods({
        oldShowPtr:isc.Hover.show,
        oldHidePtr:isc.Hover.hide,
        show: function (contents, properties, rect, targetCanvas){
            if(this.hideDelayTimer){
                this.hide(true);
            }
            this.oldShowPtr(contents,properties,rect,targetCanvas);
        },
        hide: function(ignoreDelay){
            var hoverCanvas = isc.Hover.hoverCanvas;
            if(hoverCanvas!=null){
                if(hoverCanvas.hideDelay){
                    if(!ignoreDelay){
                        if(!this.hideDelayTimer){
                            this.hideDelayTimer = isc.Hover.delayCall('hide',[true],hoverCanvas.hideDelay);
                        }
                        return;
                    }
                    if(this.hideDelayTimer) isc.Timer.clear(this.hideDelayTimer);
                    delete this.hideDelayTimer;
                }
            }
            this.oldHidePtr();
        }
    })
    Usage:
    Code:
    isc.ListGrid.create({
     ...
    fields:[{
    name:'name',headerHoverHTML: function(fieldNum,defaultHtml){
     return isc.Label.create({
       contents: this.getField(fieldNum).documentation,
      hideDelay:3000 // in milliseconds
    })
    }
    }]
    })
Working...
X