Commit 3de30aba by Jonas Jelten Committed by Jonas Jelten

fixed retry invokation for calling setState

to successfully call a function with parameters by setTimeout,
it needs to be a function that will be called by setTimeout internally.

this patch actually enables multiple tries for calling the setState function.
parent 49f3eb3b
......@@ -156,7 +156,7 @@ var JSInput = (function ($, undefined) {
// only application that has ever used JSInput, jsVGL. Something
// more sturdy should be put in place.
function whileloop(n) {
if (n < 5){
if (n > 0){
try {
if (sop) {
_deepKey(cWindow, stateSetter)(stateValue);
......@@ -169,14 +169,14 @@ var JSInput = (function ($, undefined) {
});
}
} catch (err) {
setTimeout(whileloop(n+1), 200);
setTimeout(function() { whileloop(n - 1); }, 200);
}
}
else {
console.debug("Error: could not set state");
}
}
whileloop(0);
whileloop(5);
}
}
......@@ -217,4 +217,4 @@ var JSInput = (function ($, undefined) {
walkDOM: walkDOM
};
})(window.jQuery);
\ No newline at end of file
})(window.jQuery);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment