Skip to content

Commit

Permalink
base window is dynamic, so need a method to return the value instead …
Browse files Browse the repository at this point in the history
…of a property
  • Loading branch information
slusarz committed Jun 9, 2014
1 parent ff5c160 commit 7bf481d
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions framework/Core/js/hordecore.js
Expand Up @@ -24,7 +24,6 @@ var HordeCore = {

alarms: [],
audios: [],
base: null,
handlers: {},
jsfiles: [],
loading: {},
Expand Down Expand Up @@ -190,7 +189,7 @@ var HordeCore = {

sessionId: function(sid)
{
var conf = (this.base || window).HordeCore.conf;
var conf = this.baseWindow().HordeCore.conf;

if (conf.SID) {
if (sid) {
Expand Down Expand Up @@ -632,6 +631,19 @@ var HordeCore = {
: url;
},

baseWindow: function()
{
try {
if (parent.opener &&
parent.opener.location.host == window.location.host &&
parent.opener.HordeCore) {
return parent.opener.HordeCore.baseWindow();
}
} catch (e) {}

return window;
},

initHandler: function(type)
{
var h, t;
Expand Down Expand Up @@ -734,9 +746,7 @@ var HordeCore = {

onDomLoad: function()
{
/* Determine base window. Need a try/catch block here since, if the
* page was loaded by an opener out of this current domain, this will
* throw an exception. */
// @todo: Remove for H6
try {
if (parent.opener &&
parent.opener.location.host == window.location.host &&
Expand Down

0 comments on commit 7bf481d

Please sign in to comment.