mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-13 02:08:55 +00:00
Fix for intervals not being clearable after one run.
[#147 state:resolved] Reviewed by nciagra
This commit is contained in:
1 parent
2ff51a3dbb
commit
2dc5458e63
1 file changed
+4
-2
@@ -243,13 +243,13 @@ var _CPTimerBridgeTimer = function(codeOrFunction, aDelay, shouldRepeat, functio
|
||||
theFunction = nil;
|
||||
|
||||
if (typeof codeOrFunction === "string")
|
||||
theFunction = function() { new Function(codeOrFunction)(); CPTimersForTimeoutIDs[timeoutID] = nil; }
|
||||
theFunction = function() { new Function(codeOrFunction)(); if (!shouldRepeat) CPTimersForTimeoutIDs[timeoutID] = nil; }
|
||||
else
|
||||
{
|
||||
if (!functionArgs)
|
||||
functionArgs = [];
|
||||
|
||||
theFunction = function() { codeOrFunction.apply(window, functionArgs); CPTimersForTimeoutIDs[timeoutID] = nil; }
|
||||
theFunction = function() { codeOrFunction.apply(window, functionArgs); if (!shouldRepeat) CPTimersForTimeoutIDs[timeoutID] = nil; }
|
||||
}
|
||||
|
||||
CPTimersForTimeoutIDs[timeoutID] = [CPTimer scheduledTimerWithTimeInterval:aDelay / 1000 callback:theFunction repeats:shouldRepeat];
|
||||
@@ -268,6 +268,8 @@ window.clearTimeout = function(aTimeoutID)
|
||||
|
||||
if (timer)
|
||||
[timer invalidate];
|
||||
|
||||
CPTimersForTimeoutIDs[aTimeoutID] = nil;
|
||||
}
|
||||
|
||||
window.setInterval = function(codeOrFunction, aDelay, functionArgs)
|
||||
|
||||
Reference in new issue
Block a user