ES-DOC / esdoc-questionnaire

ES-DOC Questionnaire (webform generator for creating CIM Documents). POC: @allynt
Other
2 stars 1 forks source link

Prevent user interaction during AJAX calls. #482

Closed allynt closed 7 years ago

allynt commented 7 years ago

WHO: @allynt

Prevent user interaction during AJAX calls.

allynt commented 7 years ago

Done very cleverly.

I already have code that intercepts all $http requests (to show a nice progress bar) automatically. The code for this issue [e870bb8844cb5b6fddbb21d99b14871772f639b1] blocks user interaction manually:

There is a _blocking variable defined in my "$global_services" Angular Factory (which all of my major Angular Controllers use) as well as a couple of get/set fns for it. Those fns are called by each Angular Controller as needed before and after $http requests. And there is a new <fieldset> element enclosing all forms w/ its "ng-disabled" attribute set to the value of $global_services.getBlocking().