Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Apr 29, 2016
2 parents eefc96d + 3baf5b9 commit a3ffc19
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
9 changes: 5 additions & 4 deletions dist/infinite-tree.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! infinite-tree v1.1.0 | (c) 2016 Cheton Wu <[email protected]> | MIT | https://github.com/cheton/infinite-tree */
/*! infinite-tree v1.1.1 | (c) 2016 Cheton Wu <[email protected]> | MIT | https://github.com/cheton/infinite-tree */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
Expand Down Expand Up @@ -166,8 +166,6 @@ return /******/ (function(modules) { // webpackBootstrap
var itemTarget = null;
var clickToggler = false;

(0, _helper.stopPropagation)(e);

if (e.target && e.currentTarget) {
itemTarget = e.target !== e.currentTarget ? e.target : null;
} else if (e.srcElement) {
Expand Down Expand Up @@ -199,7 +197,10 @@ return /******/ (function(modules) { // webpackBootstrap
return;
}

_this.selectNode(node);
// Use setTimeout(fn, 0) to re-queues the selectNode operation, it allows the click event to bubble up to higher level event handlers.
setTimeout(function () {
_this.selectNode(node); // selectNode will re-render the tree
}, 0);
},
// https://developer.mozilla.org/en-US/docs/Web/Events/dragstart
// The dragstart event is fired when the user starts dragging an element or text selection.
Expand Down
4 changes: 2 additions & 2 deletions dist/infinite-tree.min.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": "infinite-tree",
"version": "1.1.0",
"version": "1.1.1",
"description": "A browser-ready tree library that can efficiently display a large amount of data using infinite scrolling.",
"homepage": "https://github.com/cheton/infinite-tree",
"main": "lib/index.js",
Expand Down
8 changes: 4 additions & 4 deletions src/infinite-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { defaultRowRenderer } from './renderer';
import {
extend,
preventDefault,
stopPropagation,
addEventListener,
removeEventListener,
classNames,
Expand Down Expand Up @@ -68,8 +67,6 @@ class InfiniteTree extends events.EventEmitter {
let itemTarget = null;
let clickToggler = false;

stopPropagation(e);

if (e.target && e.currentTarget) {
itemTarget = (e.target !== e.currentTarget) ? e.target : null;
} else if (e.srcElement) { // IE8
Expand Down Expand Up @@ -100,7 +97,10 @@ class InfiniteTree extends events.EventEmitter {
return;
}

this.selectNode(node);
// Use setTimeout(fn, 0) to re-queues the selectNode operation, it allows the click event to bubble up to higher level event handlers.
setTimeout(() => {
this.selectNode(node); // selectNode will re-render the tree
}, 0);
},
// https://developer.mozilla.org/en-US/docs/Web/Events/dragstart
// The dragstart event is fired when the user starts dragging an element or text selection.
Expand Down

0 comments on commit a3ffc19

Please sign in to comment.