using dynamic import for dialogs and widgets to speed up initial load

This commit is contained in:
zadam
2019-08-20 21:40:47 +02:00
parent b818f020a7
commit fab4c59f9b
72 changed files with 1393 additions and 450 deletions

View File

@@ -4,7 +4,6 @@ import utils from './utils.js';
import server from './server.js';
import protectedSessionHolder from './protected_session_holder.js';
import infoService from "./info.js";
import protectedSessionDialog from "../dialogs/protected_session.js";
const $enterProtectedSessionButton = $("#enter-protected-session-button");
const $leaveProtectedSessionButton = $("#leave-protected-session-button");
@@ -28,7 +27,7 @@ function enterProtectedSession() {
// using deferred instead of promise because it allows resolving from outside
protectedSessionDeferred = dfd;
protectedSessionDialog.show();
import("../dialogs/protected_session.js").then(protectedSessionDialog => protectedSessionDialog.show())
}
return dfd.promise();