Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Base now fails gracefully, optimized filter loading

  • Loading branch information...
commit 93a8786cd10786ef55c10c8e3e3f592d88369da0 1 parent afb4234
Winton Welsh authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 Base.js
View
7 Base.js
@@ -51,10 +51,15 @@ var Base = new Class({
var filter = this.elements[group].filter;
var selector = this.elements[group][name];
- var elements = $ES(selector, (filter) ? $$(filter)[0] : null);
var eventName = 'on' + name.split('_').map(function(item) { return item.capitalize(); }).join('');
var regex = new RegExp(eventName + '[a-zA-Z]+');
+ if (filter && !this.el[group + '_filter']) this.el[group + '_filter'] = $$(filter)[0];
+ filter = this.el[group + '_filter'];
+
+ try { var elements = $ES(selector, filter); }
+ catch(err) { return null; }
+
// addEvent for fn matches
for (fn in this) {
if ($type(this[fn]) != 'function') continue;
Please sign in to comment.
Something went wrong with that request. Please try again.