0

https://www.drupal.org/project/webform_calculator

Hello, is there a way to delay the calculation for performance purpose ? The problem is that I have a TON of formulas being calculated every time I type inside the inputs, and this is making the whole thing very SLOW.

I need something like: "Wait 2 seconds after keyup and mouseup > show formula results"

2
  • you could try adding a .delay(2000) in line 28,29,30 in webform_calculator.js. Try like .unbind('keyup', handler).delay(2000).bind('keyup', handler)
    – No Sssweat
    Commented Aug 6, 2016 at 4:33
  • doesn't work :(
    – Rudson
    Commented Aug 6, 2016 at 9:14

1 Answer 1

1

Well, this is how I managed to delay the calculation results in webform_calculator.js line 12, 13, 14

setTimeout(function(){
  Drupal.webformCalculator.evaluateAllFormulas();
}, 3000);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.