Commit 98150a24 by Thimo Kraemer

Removed delay limit for timeout events containing server actions

parent 0dd27dcd
/*
* KSS-RPC v0.22-beta
* KSS-RPC v0.23-beta
*
* Copyright (c) 2017, joonis new media
* Author: Thimo Kraemer <thimo.kraemer@joonis.de>
......@@ -61,7 +61,7 @@
******************************************************************************************/
var kss = {
version: '0.22-beta',
version: '0.23-beta',
_initialized: false,
_ruleSheets: {},
_nodeRegister: {},
......@@ -2728,12 +2728,6 @@ kss._TimeoutEventBinder = function(handler) {
delay: null,
repeat: true
});
this.hasServerActions = kss.each(handler.rule.actions,
function(action) {
if (action.type == 'server') {
return true;
}
}) || false;
this.setTimeout();
};
......@@ -2746,16 +2740,12 @@ kss._TimeoutEventBinder.prototype = {
+ 'timeout-delay: "' + delay + '"');
return;
}
if (this.hasServerActions && delay < 1000) {
this.eventHandler.warn('Delay of timeout event must be '
+ 'at least 1000 for rules containing server actions');
delay = 1000;
}
var self = this;
setTimeout(function() {self.timeout();}, delay);
this.timer = setTimeout(function() {self.timeout();}, delay);
},
timeout: function() {
this.timer = null;
var node = this.eventHandler.node;
if (!document.documentElement.contains(node)) {
return;
......@@ -2764,6 +2754,11 @@ kss._TimeoutEventBinder.prototype = {
if (this.props('repeat')) {
this.setTimeout();
}
},
destroy: function() {
this.timer && clearTimeout(this.timer);
this.timer = null;
}
};
......
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