From f8325f4de43121c81d17d3afcb93a647c28ae0d6 Mon Sep 17 00:00:00 2001 From: jez Date: Mon, 31 Jan 2011 13:25:02 +0800 Subject: deactivateMode should always invoke the callback passed to it. --- linkHints.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linkHints.js b/linkHints.js index de498fbe..cbff300f 100644 --- a/linkHints.js +++ b/linkHints.js @@ -309,10 +309,12 @@ var linkHints = { } // we invoke the deactivate() function directly instead of using setTimeout(callback, 0) so that // deactivateMode can be tested synchronously - if (!delay) + if (!delay) { deactivate(); - else + if (callback) callback(); + } else { setTimeout(function() { deactivate(); if (callback) callback(); }, delay); + } }, /* -- cgit v1.2.3