1
0
Просмотр исходного кода

Try to solve Helios vs. main page settings.

Helios and app page, being on the same domain,
share same local storage.
If they all had their own settings object
and both saved on page unload, quirks arose.
The solution is to share the same settings object in such case.
Herby Vojčík 4 лет назад
Родитель
Сommit
f82c4f1f7f
1 измененных файлов с 9 добавлено и 1 удалено
  1. 9 1
      index.html

+ 9 - 1
index.html

@@ -24,7 +24,15 @@
                 require.callback = function () {
                     require(["helios/polyfills"], function () {
                         require(["helios/app", "amber/core/Platform-Browser"], function (amber) {
-                            amber.initialize({'transport.defaultAmdNamespace': "helios"}).then(function () {
+                            var options;
+                            if (window.opener) {
+                                // Slave: use master's settings
+                                amber.globals.SmalltalkSettings = window.opener.require('amber/helpers').globals.SmalltalkSettings;
+                            } else {
+                                // Standalone: set default amd namespace
+                                options = {'transport.defaultAmdNamespace': "helios"};
+                            }
+                            amber.initialize(options).then(function () {
                                 amber.globals.HLManager._setup();
                             });
                         });