Skip to content

Commit

Permalink
Allow complex paths on event binding.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Dooley committed Jul 14, 2016
1 parent 5191bc7 commit 8dac691
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stativus.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8dac691

Please sign in to comment.