Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle jQuery namespaced events

  • Loading branch information...
commit ed34e38d5efd40d42074b857ae36ee0d541f1479 1 parent 3940ca5
@lmarburger authored
Showing with 10 additions and 1 deletion.
  1. +1 −1  hotwire.js
  2. +9 −0 test/hotwire_test.js
View
2  hotwire.js
@@ -6,7 +6,7 @@
events = args.slice(1, args.length);
$(events).each(function(i, eventName) {
- var words = $(eventName.split(/[_:]/)),
+ var words = $(eventName.split(/[_:.]/)),
titleized = words.map(function(i, word) {
if (i === 0) { return word; }
View
9 test/hotwire_test.js
@@ -45,6 +45,15 @@ test("Event name with colon", function() {
.trigger("item:selected");
});
+test("Event name with period", function() {
+ expect(1);
+
+ $("ul#tabs")
+ .hotwire(delegate, "item.selected")
+ .children("#item1")
+ .trigger("item.selected");
+});
+
test("Multiple events", function() {
expect(3);
Please sign in to comment.
Something went wrong with that request. Please try again.