You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2018/02/06 16:58:39 UTC
[4/6] wicket git commit: WICKET-6523 restarting should re-set the
timeout
WICKET-6523 restarting should re-set the timeout
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/871cf7d2
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/871cf7d2
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/871cf7d2
Branch: refs/heads/master
Commit: 871cf7d279a764c5192d5c61a4d8aff9ec8e5e2f
Parents: db92a09
Author: Sven Meier <sv...@apache.org>
Authored: Wed Jan 24 19:46:27 2018 +0100
Committer: Sven Meier <sv...@apache.org>
Committed: Tue Feb 6 16:20:11 2018 +0100
----------------------------------------------------------------------
.../apache/wicket/ajax/AbstractAjaxTimerBehavior.java | 13 +++++--------
wicket-core/src/test/js/timer.js | 4 +++-
2 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/871cf7d2/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java
index 25dd1b7..d193691 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java
@@ -154,21 +154,18 @@ public abstract class AbstractAjaxTimerBehavior extends AbstractDefaultAjaxBehav
}
/**
- * Re-enables the timer if already stopped
+ * Restart the timer.
*
* @param target
* may be null
*/
public final void restart(final IPartialPageRequestHandler target)
{
- if (stopped == true)
- {
- stopped = false;
+ stopped = false;
- if (target != null)
- {
- setTimeout(target.getHeaderResponse());
- }
+ if (target != null)
+ {
+ setTimeout(target.getHeaderResponse());
}
}
http://git-wip-us.apache.org/repos/asf/wicket/blob/871cf7d2/wicket-core/src/test/js/timer.js
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/timer.js b/wicket-core/src/test/js/timer.js
index c95c20b..48efdaa 100644
--- a/wicket-core/src/test/js/timer.js
+++ b/wicket-core/src/test/js/timer.js
@@ -51,6 +51,8 @@ jQuery(document).ready(function() {
Wicket.Timer.clear(timerId);
ok(typeof(Wicket.TimerHandles[timerId]) === 'undefined', "There is no handle to the timeout!");
- start();
+ setTimeout(function() {
+ start();
+ }, 2);
});
});