Updated build

This commit is contained in:
Christoph Oberhofer
2014-12-19 13:23:18 +01:00
parent 93d92f2a6f
commit ebceb1f78c
2 changed files with 22 additions and 2 deletions
+20
View File
@@ -6854,6 +6854,10 @@ define('events',[],function() {
} }
return events[eventName]; return events[eventName];
} }
function clearEvents(){
events = {};
}
function publishSubscription(subscription, data) { function publishSubscription(subscription, data) {
if (subscription.async) { if (subscription.async) {
@@ -6902,6 +6906,22 @@ define('events',[],function() {
async: async, async: async,
once: true once: true
}); });
},
unsubscribe: function(eventName, callback) {
var event;
if (eventName) {
event = getEvent(eventName);
if (event && callback) {
event.subscribers = event.subscribers.filter(function(subscriber){
return subscriber.callback !== callback;
});
} else {
event.subscribers = [];
}
} else {
clearEvents();
}
} }
}; };
}(); }();
+2 -2
View File
File diff suppressed because one or more lines are too long