Properly handle and trigger events
This commit is contained in:
1 parent
04e550ebe7
commit
f3dee50448
3 files changed
+5
-5
No files matched your search
@@ -24,7 +24,7 @@ var UpdaterBase = new Class({
|
|||||||
self.doUpdate();
|
self.doUpdate();
|
||||||
else {
|
else {
|
||||||
App.unBlockPage();
|
App.unBlockPage();
|
||||||
App.on('message', 'No updates available');
|
App.trigger('message', ['No updates available']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ var NotificationBase = new Class({
|
|||||||
// Process data
|
// Process data
|
||||||
if(json){
|
if(json){
|
||||||
Array.each(json.result, function(result){
|
Array.each(json.result, function(result){
|
||||||
App.trigger(result.type, result);
|
App.trigger(result.type, [result]);
|
||||||
if(result.message && result.read === undefined)
|
if(result.message && result.read === undefined)
|
||||||
self.showMessage(result.message);
|
self.showMessage(result.message);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -364,7 +364,7 @@
|
|||||||
|
|
||||||
if(!on_complete && typeOf(args) == 'function'){
|
if(!on_complete && typeOf(args) == 'function'){
|
||||||
on_complete = args;
|
on_complete = args;
|
||||||
args = {};
|
args = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create parallel callback
|
// Create parallel callback
|
||||||
@@ -372,7 +372,7 @@
|
|||||||
self.global_events[name].each(function(handle, nr){
|
self.global_events[name].each(function(handle, nr){
|
||||||
|
|
||||||
callbacks.push(function(callback){
|
callbacks.push(function(callback){
|
||||||
var results = handle(args || {});
|
var results = handle.apply(handle, args || []);
|
||||||
callback(null, results || null);
|
callback(null, results || null);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -593,4 +593,4 @@ var createSpinner = function(target, options){
|
|||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
return new Spinner(opts).spin(target);
|
return new Spinner(opts).spin(target);
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user