src/heatmap.js
function delegate(callback, el) {
        var currentElement = el;

        do {
            if (!isClickTarget(currentElement)) continue;
            callback(currentElement);
            return;
        } while(currentElement.nodeName.toUpperCase() !== 'BODY' && (currentElement = currentElement.parentNode));
    }
function delegate(callback, el) {
        var currentElement = el;

        do {
            if (!isClickTarget(currentElement)) continue;
            callback(currentElement);
            return;
        } while(currentElement.nodeName.toUpperCase() !== 'BODY' && (currentElement = currentElement.parentNode));
    }
function delegate ( callback , el ) { var currentElement = el ; do { if ( ! isClickTarget ( currentElement ) ) continue ; callback ( currentElement ) ; return ; } while ( currentElement . nodeName . toUpperCase ( ) !== 'BODY' && ( currentElement = currentElement . parentNode ) ) ; }
A deligation loop to find the clicked element and execute click callback
with that element.
A deligation loop to find the clicked element and execute click callback with that element .