You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2014/08/18 11:28:34 UTC
[3/3] git commit: Improve comments,
logs and variable names. No functional changes
Improve comments, logs and variable names. No functional changes
(cherry picked from commit 5af8ea44e905fb70390e129e93ff1862ea1ff30d)
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b559271c
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b559271c
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b559271c
Branch: refs/heads/master
Commit: b559271c00102e626358b80e91393ed9d683deb5
Parents: c95ee1b
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Mon Aug 18 12:27:35 2014 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Mon Aug 18 12:28:21 2014 +0300
----------------------------------------------------------------------
.../apache/wicket/ajax/res/js/wicket-ajax-jquery.js | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/b559271c/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index 699048c..34f88d0 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -261,7 +261,7 @@
var res = name.match(/^([^|]+)\|(d|s|a)$/);
if (isUndef(res)) {
this.name = '0'; // '0' is the default channel name
- this.type = 's'; // default to stack
+ this.type = 's'; // default to stack/queue
}
else {
this.name = res[1];
@@ -282,14 +282,14 @@
}
} else {
var busyChannel = "Channel '"+ this.name+"' is busy";
- if (this.type === 's') { // stack
+ if (this.type === 's') { // stack/queue
Wicket.Log.info(busyChannel + " - scheduling the callback to be executed when the previous request finish.");
this.callbacks.push(callback);
}
else if (this.type === 'd') { // drop
- Wicket.Log.info(busyChannel + " - dropping all previous scheduled callbacks and scheduled a new one to be executed when the current request finish.");
+ Wicket.Log.info(busyChannel + " - dropping all previous scheduled callbacks and scheduling a new one to be executed when the current request finish.");
this.callbacks = [];
- this.callbacks[0] = callback;
+ this.callbacks.push(callback);
} else if (this.type === 'a') { // active
Wicket.Log.info(busyChannel + " - ignoring the Ajax call because there is a running request.");
}
@@ -298,17 +298,17 @@
},
done: function () {
- var c = null;
+ var callback = null;
if (this.callbacks.length > 0) {
- c = this.callbacks.shift();
+ callback = this.callbacks.shift();
}
- if (c !== null && typeof(c) !== "undefined") {
+ if (callback !== null && typeof(callback) !== "undefined") {
Wicket.Log.info("Calling postponed function...");
// we can't call the callback from this call-stack
// therefore we set it on timer event
- window.setTimeout(c, 1);
+ window.setTimeout(callback, 1);
} else {
this.busy = false;
}