In order to be able to have control over the loading screen, we need to use the following variable at the top of our script (in any kind of section)
$manual_loading = false;
This will start the loading screen, but it will not hide until you manually hide it at a given moment using JS with a simple hide() function on the element #kasLoader.
$('#kasLoader').fadeOut(400);