Skip to content

Instantly share code, notes, and snippets.

@ryanmr
Created December 27, 2009 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanmr/264220 to your computer and use it in GitHub Desktop.
Save ryanmr/264220 to your computer and use it in GitHub Desktop.
var body = $(document.body);
var b = body.getElement("b");
//Listener class executes a logging function each time a method is called.
var Listener = new Class({
listenStack: {},
addListener: function(mth, fn) {
this.listenStack[mth] = this[mth];
this[mth] = function() {
var rtrn = this.listenStack[mth].attempt(arguments);
fn(rtrn, arguments);
};
}
});
Fx.Tween.implement(Listener);
Element.implement(Listener);
Element.addListener("tween", function(rtrn, args){
console.log("returned: " + rtrn);
console.log(args);
});
b.tween("padding", [0, 30]);
// I'd expect the console's to fire, but instead, TypeError: this.attachEvent is not a function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment