for message without data, send empty object

This commit is contained in:
rolux 2013-02-25 12:44:22 +05:30
parent 6787d811e6
commit fde3fbf74a
2 changed files with 6 additions and 4 deletions

View file

@ -298,14 +298,16 @@ Ox.load.UI = function(options, callback) {
Ox.forEach(arguments[0], function(callback, event) {
Ox.Message.bind(function(event_, data, oxid) {
if (event_ == event && Ox.isUndefined(oxid)) {
callback(data);
callback(data || {});
}
});
});
} else {
callback = arguments[0];
Ox.Message.bind(function(event, data, oxid) {
Ox.isUndefined(oxid) && callback(event, data);
if (Ox.isUndefined(oxid)) {
callback(event, data || {});
}
});
}
return this;

View file

@ -364,7 +364,7 @@ Ox.Element = function(options, self) {
Ox.forEach(arguments[0], function(callback, event) {
Ox.Message.bind(arguments[0], function(event_, data, oxid) {
if (event_ == event && oxid == that.oxid) {
callback(data);
callback(data || {});
}
});
});
@ -372,7 +372,7 @@ Ox.Element = function(options, self) {
callback = arguments[0];
Ox.Message.bind(function(event, data, oxid) {
if (that.oxid == oxid) {
callback(event, data);
callback(event, data || {});
}
});
}