Skip to content
This repository was archived by the owner on Apr 16, 2019. It is now read-only.

Commit 94a1638

Browse files
author
Ian Maffett
committed
filter events off namespace
1 parent 8961779 commit 94a1638

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

appframework.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,6 +2352,12 @@ if (!window.af || typeof(af) !== "function") {
23522352
var delegate = getDelegate && getDelegate(fn, event),
23532353
callback = delegate || fn;
23542354
var proxyfn = function(event) {
2355+
if (event.ns){
2356+
var matcher = matcherFor(event.ns);
2357+
if(!matcher.test(handler.ns))
2358+
return;
2359+
}
2360+
23552361
var result = callback.apply(element, [event].concat(event.data));
23562362
if (result === false)
23572363
event.preventDefault();
@@ -2610,8 +2616,12 @@ if (!window.af || typeof(af) !== "function") {
26102616
* @title $().trigger(event,data);
26112617
*/
26122618
$.fn.trigger = function(event, data, props) {
2613-
if (typeof event === "string")
2614-
event = $.Event(event, props);
2619+
if (typeof event === "string"){
2620+
props=props||{}
2621+
event = parse(event);
2622+
props.ns=event.ns;
2623+
event = $.Event(event.e, props);
2624+
}
26152625
event.data = data;
26162626
for (var i = 0, len = this.length; i < len; i++) {
26172627
this[i].dispatchEvent(event);

0 commit comments

Comments
 (0)