diff --git a/web/pgadmin/browser/templates/browser/index.html b/web/pgadmin/browser/templates/browser/index.html index 5bd054a..ad8a4ee 100644 --- a/web/pgadmin/browser/templates/browser/index.html +++ b/web/pgadmin/browser/templates/browser/index.html @@ -29,18 +29,23 @@ require.onResourceLoad = function (context, map, depMaps) { // we will call onResourceLoad(false) by ourselves when requirejs // is not loading anything hide the indicator and exit setTimeout(function() { - if (panel != null) { - $(panel).remove(); + if (panel != null && window.jQuery) { + var $ = window.jQuery; + $(panel).hide().find('.pg-sp-text').text('{{ _("Loading the dependent resources...") }}'); return; } - }, 500); + }, 1); + return; + } + if (window.jQuery) { + window.jQuery(panel).show(); } // show indicator when any module is loaded and // shedule requirejs status (loading/idle) check panel.style.display = ""; clearTimeout(panel.ttimer); - panel.ttimer = setTimeout(function () { + panel.ttimer = setInterval(function () { var context = require.s.contexts._; var inited = true; for (name in context.registry) { @@ -54,11 +59,12 @@ require.onResourceLoad = function (context, map, depMaps) { // here the "inited" variable will be true, if requirejs is "idle", // false if "loading" if (inited) { - // will fire if module loads in 400ms. TODO: reset this timer - // for slow module loading + // will fire if module loads in 400ms. + // TODO: reset this timer for slow module loading + clearTimeout(this.ttimer); require.onResourceLoad(false); } - }, 400) + }.bind(panel), 200); } }; {% endblock %}