Skip to content

Commit

Permalink
check to ensure that our parent is an element and not a fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
rniemeyer committed Apr 11, 2014
1 parent b140959 commit b63ae4b
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 103 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "knockout-delegatedEvents",
"version": "0.3.0",
"version": "0.3.1",
"main": "build/knockout-delegatedEvents.min.js",
"ignore": [
"examples",
Expand Down
4 changes: 2 additions & 2 deletions build/knockout-delegatedEvents.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// knockout-delegatedEvents 0.3.0 | (c) 2014 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license
// knockout-delegatedEvents 0.3.1 | (c) 2014 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license
;(function(factory) {
//CommonJS
if (typeof require === "function" && typeof exports === "object" && typeof module === "object") {
Expand All @@ -21,7 +21,7 @@

//loop until we either find an action, run out of elements, or hit the root element that has our delegated handler
while (!method && el) {
method = el.getAttribute(attr) || ko.utils.domData.get(el, key);
method = el.nodeType === 1 && (el.getAttribute(attr) || ko.utils.domData.get(el, key));
if (!method) {
el = el !== root ? el.parentNode : null;
}
Expand Down
4 changes: 2 additions & 2 deletions build/knockout-delegatedEvents.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</div>


<script src="../ext/knockout-3.0.0.js"></script>
<script src="../ext/knockout-3.1.0.js"></script>
<script src="../src/knockout-delegatedEvents.js"></script>
<script>
var Item = function(id, name, price, description) {
Expand Down
94 changes: 0 additions & 94 deletions ext/knockout-3.0.0.js

This file was deleted.

96 changes: 96 additions & 0 deletions ext/knockout-3.1.0.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "knockout-delegatedEvents",
"version": "0.3.0",
"version": "0.3.1",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "0.x.x",
Expand Down
2 changes: 1 addition & 1 deletion spec/runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<script type="text/javascript" src="lib/boot.js"></script>

<!-- dependencies -->
<script src="../ext/knockout-3.0.0.js" type="text/javascript"></script>
<script src="../ext/knockout-3.1.0.js" type="text/javascript"></script>

<!-- source files -->
<script src="../src/knockout-delegatedEvents.js" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion src/knockout-delegatedEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

//loop until we either find an action, run out of elements, or hit the root element that has our delegated handler
while (!method && el) {
method = el.getAttribute(attr) || ko.utils.domData.get(el, key);
method = el.nodeType === 1 && (el.getAttribute(attr) || ko.utils.domData.get(el, key));
if (!method) {
el = el !== root ? el.parentNode : null;
}
Expand Down

0 comments on commit b63ae4b

Please sign in to comment.