Permalink
Browse files

Allow binding to global events with the "global:" prefix on controlle…

…r event names
  • Loading branch information...
1 parent 9be2d77 commit 86c93bac3e29291f7bdf2713dfeff7da46ccbc59 @pindia committed May 27, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 agility.js
View
@@ -923,7 +923,10 @@
// Bind all controllers to their events
for (var ev in object.controller) {
if (typeof object.controller[ev] === 'function') {
- object.bind(ev, object.controller[ev]);
+ if(ev.match(/^global:/))
+ $$.document.bind(ev.slice('7'), object.controller[ev]);
+ else
+ object.bind(ev, object.controller[ev]);
}
}

0 comments on commit 86c93ba

Please sign in to comment.