From 70bd7afd67bd5dc47d1cc6194e51f72f1abd0a06 Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 7 Dec 2013 15:49:41 +0100 Subject: [PATCH] Ox.Element: make onMessage alias of bindMessage, reserve other message methods, update docs --- source/Ox.UI/js/Core/Element.js | 93 ++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 41 deletions(-) diff --git a/source/Ox.UI/js/Core/Element.js b/source/Ox.UI/js/Core/Element.js index 4d1bf618..96eb8556 100644 --- a/source/Ox.UI/js/Core/Element.js +++ b/source/Ox.UI/js/Core/Element.js @@ -300,7 +300,7 @@ Ox.Element = function(options, self) { (event, callback) -> This element Adds a handler for a single event ({event: callback, ...}) -> This element - Adds handlers for multiple events + Adds handlers for one or more events callback Callback function data event data (key/value pairs) event Event name @@ -318,7 +318,7 @@ Ox.Element = function(options, self) { (event, callback) -> This element Adds a handler for a single event ({event: callback, ...}) -> This element - Adds handlers for multiple events + Adds handlers for one or more events callback Callback function data event data (key/value pairs) event Event name @@ -329,6 +329,45 @@ Ox.Element = function(options, self) { return that; }; + /*@ + bindMessage Adds message handlers (if the element is an iframe) + (callback) -> This element + Adds a catch-all handler + (event, callback) -> This element + Adds a handler for a single event + ({event: callback, ...}) -> This element + Adds handlers for on or more events + callback Callback function + data event data (key/value pairs) + event Event name + @*/ + that.bindMessage = that.onMessage = function() { + var callback; + if (self.options.element == '