Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added tests

  • Loading branch information...
commit 37fba5f9b387bf7aeef2a5b4906db65e005664c7 1 parent e9660b0
@mkuklis authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 asevented.js
View
6 asevented.js
@@ -9,7 +9,7 @@
var asEvented = (function () {
var events = {};
-
+
function bind(event, fn) {
events[event] = events[event] || [];
events[event].push(fn);
@@ -22,12 +22,12 @@ var asEvented = (function () {
function trigger(event) {
if (event in events === false) return;
- for (var i = 0, l = events[event].length; i < l; i++) {
+ for (var i = events[event].length - 1; i >= 0; i--) {
events[event][i].apply(this, [].slice.call(arguments, 1));
}
}
- return function (options) {
+ return function () {
this.bind = bind;
this.unbind = unbind;
this.trigger = trigger;
Please sign in to comment.
Something went wrong with that request. Please try again.