Skip to content

Instantly share code, notes, and snippets.

@pschyska
Created October 13, 2010 10:10
Show Gist options
  • Save pschyska/cbb3ad5e972a11dc01b4 to your computer and use it in GitHub Desktop.
Save pschyska/cbb3ad5e972a11dc01b4 to your computer and use it in GitHub Desktop.
var classesList = function(pref){
var res = [];
for (name in this) {
if (this[name].xtype) {
res.push(pref + name);
this[name].classesList = classesList; // define the same function on each property on the fly
res = res.concat(this[name].classesList(pref + name + ".")); // ... and call it, providing our name along with the scope
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment