Currently, the editor triggers an event on every keypress and this results in an multiple ajax calls and also bad user experience. (especially in the online editor)
lib.js:
form.on("input", "input, textarea", function() { form.trigger("change"); });
main.js:
form.on("change", function() { clearTimeout(timer); preview.addClass("loading"); timer = setTimeout(function() { var data = builder.getFormValues(); form.data("resume", data); postResume(data); }, 200); });
While there are probably many ways to optimize this, one option is to use _.debounce (lodash library is already part of lib) to rate limit the ajax requests.
I currently don't have vagrant setup but if there is enough interest I could make a pull request for this change.
Currently, the editor triggers an event on every keypress and this results in an multiple ajax calls and also bad user experience. (especially in the online editor) lib.js:
form.on("input", "input, textarea", function() { form.trigger("change"); });
main.js:form.on("change", function() { clearTimeout(timer); preview.addClass("loading"); timer = setTimeout(function() { var data = builder.getFormValues(); form.data("resume", data); postResume(data); }, 200); });
While there are probably many ways to optimize this, one option is to use _.debounce (lodash library is already part of lib) to rate limit the ajax requests.
I currently don't have vagrant setup but if there is enough interest I could make a pull request for this change.