From 8dac691b8b112fdd2dbb24a5633319a289cd3ef6 Mon Sep 17 00:00:00 2001 From: Jason Dooley Date: Thu, 14 Jul 2016 11:40:47 -0700 Subject: [PATCH] Allow complex paths on event binding. --- stativus.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stativus.js b/stativus.js index 0bd658c..8eb711b 100644 --- a/stativus.js +++ b/stativus.js @@ -234,7 +234,10 @@ Stativus.State = { var split, evt, selector, toFire; split = key.split(' '); evt = split[0]; - selector = split[1]; + + // allow for complex paths + // 'change #foo .bar select' + selector = key.replace(evt,""); toFire = events[key]; if(remove) removeEvent(evt, selector); else addEvent(evt, selector, toFire);