Skip to content

Commit

Permalink
Merge pull request #93 from sevifives/master
Browse files Browse the repository at this point in the history
Allow complex paths on event binding.
  • Loading branch information
etgryphon authored Jul 15, 2016
2 parents 5191bc7 + 8dac691 commit 3381d40
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 3381d40

Please sign in to comment.