for message without data, send empty object
This commit is contained in:
parent
6787d811e6
commit
fde3fbf74a
2 changed files with 6 additions and 4 deletions
|
@ -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;
|
||||
|
|
|
@ -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 || {});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue