Browse files

Remote behaviors now bind callbacks to the event instance

git-svn-id: http://svn.danwebb.net/external/lowpro/trunk@417 a686c101-5f17-0410-80e1-b267258107f6
  • Loading branch information...
1 parent 9743265 commit c70db2c9d5a7b7f6b53747130e660ec89f224424 danwebb committed Mar 19, 2008
Showing with 7 additions and 7 deletions.
  1. +2 −2 dist/lowpro.js
  2. BIN dist/lowpro.zip
  3. +2 −2 src/core_behaviors.js
  4. +2 −2 test/lowpro.js
  5. +1 −1 test/test-b-classes.html
View
4 dist/lowpro.js
@@ -284,8 +284,8 @@ Remote.Base = {
},
_bindCallbacks: function() {
$w('onCreate onComplete onException onFailure onInteractive onLoading onLoaded onSuccess').each(function(cb) {
- if (Object.isFunction(this[cb.toLowercase()]))
- this.options[cb] = this[cb.toLowercase()].bind(this);
+ if (Object.isFunction(this.options[cb]))
+ this.options[cb] = this.options[cb].bind(this);
}.bind(this));
}
}
View
BIN dist/lowpro.zip
Binary file not shown.
View
4 src/core_behaviors.js
@@ -20,8 +20,8 @@ Remote.Base = {
},
_bindCallbacks: function() {
$w('onCreate onComplete onException onFailure onInteractive onLoading onLoaded onSuccess').each(function(cb) {
- if (Object.isFunction(this[cb.toLowercase()]))
- this.options[cb] = this[cb.toLowercase()].bind(this);
+ if (Object.isFunction(this.options[cb]))
+ this.options[cb] = this.options[cb].bind(this);
}.bind(this));
}
}
View
4 test/lowpro.js
@@ -284,8 +284,8 @@ Remote.Base = {
},
_bindCallbacks: function() {
$w('onCreate onComplete onException onFailure onInteractive onLoading onLoaded onSuccess').each(function(cb) {
- if (Object.isFunction(this[cb.toLowercase()]))
- this.options[cb] = this[cb.toLowercase()].bind(this);
+ if (Object.isFunction(this.options[cb]))
+ this.options[cb] = this.options[cb].bind(this);
}.bind(this));
}
}
View
2 test/test-b-classes.html
@@ -22,7 +22,7 @@
Event.addBehavior({
'.dates' : DateSelector,
- '.remote' : Remote({ method: 'post' }),
+ '.remote' : Remote({ method: 'post', onCreate: function() { console.log(this) } }),
'.remote_form' : Remote,
'#date2': Observed(function() { console.log('changed field') }, { frequency: 0.2 })
});

0 comments on commit c70db2c

Please sign in to comment.