Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions js/clickheat-original.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,15 @@ function catchClickHeat(e)
/** Little waiting cycle: default is to wait until Ajax sent or until the end of the time if no Ajax is available */
now = new Date();
clickHeatLocalWait = now.getTime() + clickHeatWait;
while (clickHeatLocalWait > now.getTime())
{
now = new Date();
}
/* by adding the wait cycle to the onbeforeunload event, it will not run until the
page navigates away. This will prevent delays on clicks that do not cause navigation
such as form elements. */
addEvtListener(window, 'onbeforeunload', function() {
while (clickHeatLocalWait > now.getTime())
{
now = new Date();
}
});
}
catch (err)
{
Expand Down Expand Up @@ -296,4 +301,4 @@ function initClickHeat()
}
}
showClickHeatDebug('ClickHeat initialised with:<br/>site = ' + clickHeatSite + '<br/>group = ' + clickHeatGroup + '<br/>server = ' + clickHeatServer + '<br/>quota = ' + (clickHeatQuota === -1 ? 'unlimited' : clickHeatQuota) + '<br/><br/>browser = ' + clickHeatBrowser + '<br/><strong>Click in a blank area (not on a link) to test ClickHeat</strong>');
}
}