Skip to content

Commit

Permalink
1.0.28
Browse files Browse the repository at this point in the history
  • Loading branch information
kupriyanenko committed Apr 16, 2015
1 parent 15a23a9 commit 20899a6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jbone",
"version": "1.0.27",
"version": "1.0.28",
"main": "dist/jbone.js",
"ignore": [
"**/.*",
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jbone",
"repo": "kupriyanenko/jbone",
"description": "JavaScript Library for DOM manipulation. Replacement jQuery for Backbone in browsers (2.5kb gzipped)",
"version": "1.0.27",
"version": "1.0.28",
"keywords": [
"jquery",
"jbone",
Expand Down
23 changes: 15 additions & 8 deletions dist/jbone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jBone v1.0.27 - 2015-04-14 - Library for DOM manipulation
* jBone v1.0.28 - 2015-04-17 - Library for DOM manipulation
*
* https://github.com/kupriyanenko/jbone
*
Expand Down Expand Up @@ -385,6 +385,7 @@ jBone.event = {
// if propagation is not stopped
!(event && event.isImmediatePropagationStopped());
i++) {
expectedTarget = null;
eventOptions = {};
handler = handlerQueue[i];
handler.data && (eventOptions.data = handler.data);
Expand All @@ -400,20 +401,26 @@ jBone.event = {
// event handler with selector
else if (
// if target and selected element the same
~(targets = jBone(el).find(handler.selector)).indexOf(e.target) ||
~(targets = jBone(el).find(handler.selector)).indexOf(e.target) && (expectedTarget = e.target) ||
// if one of element matched with selector contains target
(el !== e.target && el.contains(e.target))
) {
l = targets.length;

// get element matched with selector
for (; j < length; j++) {
if (targets[j] && targets[j].contains(e.target)) {
expectedTarget = targets[j];
if (!expectedTarget) {
l = targets.length;
j = 0;

for (; j < l; j++) {
if (targets[j] && targets[j].contains(e.target)) {
expectedTarget = targets[j];
}
}
}

expectedTarget = expectedTarget || e.target;
if (!expectedTarget) {
continue;
}

eventOptions.currentTarget = expectedTarget;
event = new BoneEvent(e, eventOptions);

Expand Down
Loading

0 comments on commit 20899a6

Please sign in to comment.