Ox.parent -> Ox.

This commit is contained in:
rlx 2014-09-25 18:30:49 +02:00
parent 41bf6ac372
commit 86f1bad4eb

View file

@ -63,13 +63,13 @@
if (message.data.oxid) {
// The inner window receives the oxid of the outer iframe element
Ox.oxid = message.data.oxid;
Ox.parent.postMessage('init', {})
Ox.$parent.postMessage('init', {})
} else if (message.target) {
// The outer window receives init from iframe
Ox.elements[message.target].triggerEvent('init');
}
} else {
(message.target ? Ox.elements[message.target] : Ox.parent)
(message.target ? Ox.elements[message.target] : Ox.$parent)
.triggerMessage(message.event, message.data);
}
}
@ -186,9 +186,9 @@
}
/*@
Ox.parent <o> Proxy to be used by iframes for messaging with outer window
Ox.$parent <o> Proxy to be used by iframes for messaging with outer window
@*/
Ox.parent = Ox.$parent = (function() {
Ox.$parent = (function() {
var self = {messageCallbacks: {}},
that = {oxid: Ox.uid()};
@ -374,7 +374,7 @@
Adds handlers for multiple messages
self <o> Object with `messageCallbacks` (`Ox.Element`'s `self`)
If `self` is missing and this method is not rebound, then the
handler is bound to the outer window (via `Ox.parent`)
handler is bound to the outer window (via `Ox.$parent`)
message <s> Message name
callback <f> Callback function
data <o> Message data (key/value pairs)
@ -399,7 +399,7 @@
Adds handlers for multiple messages
self <o> Object with `messageCallbacks` (`Ox.Element`'s `self`)
If `self` is missing and this method is not rebound, then the
handler is bound to the outer window (via `Ox.parent`)
handler is bound to the outer window (via `Ox.$parent`)
message <s> Message name
callback <f> Callback function
data <o> Message data (key/value pairs)
@ -425,7 +425,7 @@
data <o> Message data (key/value pairs)
@*/
that.post = function() {
var isParent = this == Ox.parent,
var isParent = this == Ox.$parent,
target = isParent ? window.parent : this[0].contentWindow;
Ox.forEach(
Ox.makeObject(Ox.slice(arguments)),
@ -472,7 +472,7 @@
Removes handlers for multiple messages
self <o> Object with `messageCallbacks` (`Ox.Element`'s `self`)
If `self` is missing and this method is not rebound, then the
handler is bound to the outer window (via `Ox.parent`)
handler is bound to the outer window (via `Ox.$parent`)
message <s> Message name
callback <f> Message handler
@*/