Skip to content

Instantly share code, notes, and snippets.

@RStankov
Created August 22, 2009 22:17
Show Gist options
  • Save RStankov/173015 to your computer and use it in GitHub Desktop.
Save RStankov/173015 to your computer and use it in GitHub Desktop.
$H(Element.Storage).inject(0, function(m, p){
var registry;
if (p.value.get && (registry = p.value.get('prototype_event_registry'))){
m += registry.values().flatten().size();
}
return m;
});
// bookmarked, witch uses Element.Storage or Event.cache dependent on the Prototype version
(Element.Storage ? $H(Element.Storage).values().slice(1).invoke('get', 'prototype_event_registry').compact() :
Event.cache.values()).inject(0, function(m, p){ return m += $H(p).values().flatten().size(); });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment