better idCheck and configurable interval timing

This commit is contained in:
Barbara Miller 2018-03-13 17:36:38 -07:00
parent 037e4193ab
commit cd3fa154d9

View File

@ -25,7 +25,7 @@ class UmbraBehavior {
this.alreadyDone = [];
this.idleSince = null;
this.intervalId = null;
this.intervalTimeMs = 300;
this.intervalTimeMs = {{interval or '300'}};
this.index = 0;
}
@ -33,7 +33,7 @@ class UmbraBehavior {
// should match older default and simpleclicks behavior, and more
var k = this.index;
var selector = this.actions[k].selector;
var idCheck = this.actions[k].idcheck ? this.actions[k].idcheck : true;
var idCheck = this.actions[k].idcheck === false ? this.actions[k].idcheck : true;
var action = this.actions[k].do ? this.actions[k].do : 'click';
var closeSelector = this.actions[k].closeSelector ? this.actions[k].closeSelector : null;
var didSomething = false;
@ -63,7 +63,7 @@ class UmbraBehavior {
continue;
}
for ( var i = 0; i < doTargetsLength; i++) {
if idCheck and (this.alreadyDone.indexOf(doTargets[i]) > -1) {
if (idCheck && this.alreadyDone.indexOf(doTargets[i]) > -1) {
continue;
}
if (!this.isVisible(doTargets[i])) {