1
0
Fork 0
forked from 0x2620/oxjs

cleanup Message code

This commit is contained in:
rolux 2013-02-24 15:06:08 +05:30
commit c1f9e9d7a3
3 changed files with 23 additions and 22 deletions

View file

@ -93,12 +93,12 @@ Ox.Element = function(options, self) {
that.on('load', function() {
Ox.Message.post(that, 'init', {id: that.oxid});
});
that.onMessage = function(callback) {
that.onMessage = function() {
var callback;
if (Ox.isObject(arguments[0])) {
Ox.forEach(function(callback, event) {
Ox.Message.bind(arguments[0], function(evt, data, oxid) {
if (that.oxid ==oxid && event == evt) {
Ox.forEach(arguments[0], function(callback, event) {
Ox.Message.bind(arguments[0], function(event_, data, oxid) {
if (event_ == event && oxid == that.oxid) {
callback(data);
}
});