1
0
Prechádzať zdrojové kódy

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 rokov pred
rodič
commit
f82c4f1f7f
1 zmenil súbory, kde vykonal 9 pridanie a 1 odobranie
  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();
                             });
                         });