Permalink
Browse files

- Class: this.parent is now resetted correctly after a method call.

 - Fx, Request: check method now respects its caller.

Thank you RD for the bug report.

git-svn-id: http://svn.mootools.net/trunk@1530 4db308c1-fb21-0410-9919-de62e267375e
  • Loading branch information...
1 parent 9a9278b commit 07986703d98d358dc9e9604194b8f7b930341ed1 kamicane committed Apr 10, 2008
Showing with 7 additions and 7 deletions.
  1. +5 −5 Source/Class/Class.js
  2. +1 −1 Source/Fx/Fx.js
  3. +1 −1 Source/Request/Request.js
View
@@ -17,8 +17,6 @@ var Class = new Native({
var klass = function(){
for (var property in this) this[property] = $unlink(this[property]);
- this.parent = null;
-
for (var Property in Class.Mutators){
if (!this[Property]) continue;
Class.Mutators[Property](this, this[Property]);
@@ -63,15 +61,17 @@ Class.Mutators.Extends = function(self, klass){
var kp = klass[property];
var sp = self[property];
self[property] = (function(previous, current){
- if ($defined(current) && previous != current){
+ if (current != undefined && previous != current){
var type = $type(current);
if (type != $type(previous)) return current;
switch (type){
case 'function':
return function(){
- current.parent = this.parent = previous.bind(this);
- var value = current.apply(this, arguments);
+ var previousParent = this.parent;
+ if (!current.parent) current.parent = previous.bind(this);
this.parent = current.parent;
+ var value = current.apply(this, arguments);
+ this.parent = previousParent;
return value;
};
case 'object': return $merge(previous, current);
View
@@ -56,7 +56,7 @@ var Fx = new Class({
if (!this.timer) return true;
switch (this.options.link){
case 'cancel': this.cancel(); return true;
- case 'chain': this.chain(this.start.bind(this, arguments)); return false;
+ case 'chain': this.chain(arguments.callee.caller.bind(this, arguments)); return false;
}
return false;
},
@@ -96,7 +96,7 @@ var Request = new Class({
if (!this.running) return true;
switch (this.options.link){
case 'cancel': this.cancel(); return true;
- case 'chain': this.chain(this.send.bind(this, arguments)); return false;
+ case 'chain': this.chain(arguments.callee.caller.bind(this, arguments)); return false;
}
return false;
},

0 comments on commit 0798670

Please sign in to comment.