Skip to content

Commit

Permalink
fix bind
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony MOI committed May 9, 2012
1 parent 0b11bc2 commit 884eba9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
9 changes: 4 additions & 5 deletions cell-0.3.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/cell.js
Expand Up @@ -79,7 +79,7 @@ CELL.cell = function(spec, my) {
var bind; /* bind(); */


var that = CELL.emitter({});
var that = CELL.emitter({}, my);


/**
Expand Down Expand Up @@ -166,6 +166,7 @@ CELL.cell = function(spec, my) {
CELL.method(that, 'build', build, _super);
CELL.method(that, 'refresh', refresh, _super);
CELL.method(that, 'find', find, _super);
CELL.method(that, 'bind', bind, _super);

CELL.getter(that, 'children', my, 'children');
CELL.getter(that, 'element', my, 'element');
Expand Down
10 changes: 5 additions & 5 deletions src/event.js
Expand Up @@ -82,7 +82,6 @@ CELL.emitter = function(spec, my) {
emit = function() {
var args = Array.prototype.slice.call(arguments);
var name = args.shift();

if(my.handlers[name]) {
for(var i = 0; i < my.handlers[name].length; i++) {
if(my.handlers[name][i])
Expand All @@ -91,9 +90,9 @@ CELL.emitter = function(spec, my) {
}
if(my.handlers['*']) {
args.unshift(name);
for(var i = 0; i < my.handlers[name].length; i++) {
if(my.handlers[name][i])
my.handlers[name][i].apply(this, args);
for(var i = 0; i < my.handlers['*'].length; i++) {
if(my.handlers['*'][i])
my.handlers['*'][i].apply(this, args);
}
}
};
Expand All @@ -106,8 +105,9 @@ CELL.emitter = function(spec, my) {
off = function(type, handler) {
if(my.handlers[type]) {
for(var i = my.handlers[type].length - 1; i >= 0; i--) {
if(handler === my.handlers[type][i])
if(handler === my.handlers[type][i]) {
my.handlers[type].splice(i, 1);
}
}
}
};
Expand Down

0 comments on commit 884eba9

Please sign in to comment.