summaryrefslogtreecommitdiffstats
path: root/java/sca/modules
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/modules')
-rw-r--r--java/sca/modules/domain-manager/src/main/resources/utils.js22
1 files changed, 17 insertions, 5 deletions
diff --git a/java/sca/modules/domain-manager/src/main/resources/utils.js b/java/sca/modules/domain-manager/src/main/resources/utils.js
index 611aaceadc..20f0148954 100644
--- a/java/sca/modules/domain-manager/src/main/resources/utils.js
+++ b/java/sca/modules/domain-manager/src/main/resources/utils.js
@@ -167,7 +167,7 @@ function toolbar(home, tools) {
}
/**
- * Utility function returning an non-sparse array from an array or an object.
+ * Return an non-sparse array from an array or an object.
*/
function array(obj) {
if (obj.length == undefined) {
@@ -186,7 +186,7 @@ function array(obj) {
}
/**
- * Utility function thats dumps a Javascript object to the console
+ * Dump a Javascript object to the console
*/
function dump(o) {
for (f in o) {
@@ -196,6 +196,9 @@ function dump(o) {
}
}
+/**
+ * Return the content document of the given window.
+ */
function content(win) {
if (win.document != 'undefined' && win.document != null) {
return win.document;
@@ -206,11 +209,20 @@ function content(win) {
}
}
+/**
+ * Install a gadget
+ */
function gadget(win, doc) {
- if (win.parent.ongadget != null && win.parent.ongadget != 'undefined') {
- return win.parent.ongadget(win, doc);
+ var ongadget = null;
+ try {
+ if (win.parent.ongadget != null && win.parent.ongadget != 'undefined') {
+ ongadget = win.parent.ongadget;
+ }
+ } catch (e) {
+ }
+ if (ongadget != null) {
+ return ongadget(win, doc);
} else {
return doc;
}
}
- \ No newline at end of file