Skip to content

Commit

Permalink
Fixed jquery bug #81 #84
Browse files Browse the repository at this point in the history
  • Loading branch information
JimLiu committed Apr 2, 2014
1 parent d6c5357 commit 3ab9efb
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "angular-ui-tree",
"version": "2.0.2",
"version": "2.0.3",
"homepage": "https://github.com/JimLiu/angular-ui-tree",
"authors": [
"Jim Liu <https://github.com/JimLiu>",
Expand Down
10 changes: 7 additions & 3 deletions demo/dist/angular-ui-tree.js
@@ -1,5 +1,5 @@
/**
* @license Angular UI Tree v2.0.2
* @license Angular UI Tree v2.0.3
* (c) 2010-2014. https://github.com/JimLiu/angular-ui-tree
* License: MIT
*/
Expand Down Expand Up @@ -737,9 +737,10 @@
// disable right click
return;
}
if (e.uiTreeDragging) { // event has already fired in other scope.
if (e.uiTreeDragging || (e.originalEvent && e.originalEvent.uiTreeDragging)) { // event has already fired in other scope.
return;
}

// the element which is clicked.
var eventElm = angular.element(e.target);
var eventScope = eventElm.scope();
Expand All @@ -760,7 +761,10 @@
eventElm = eventElm.parent();
}

e.uiTreeDragging = scope; // stop event bubbling
e.uiTreeDragging = true; // stop event bubbling
if (e.originalEvent) {
e.originalEvent.uiTreeDragging = true;
}
e.preventDefault();
var eventObj = $uiTreeHelper.eventObj(e);

Expand Down
4 changes: 2 additions & 2 deletions demo/dist/angular-ui-tree.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions demo/test.html
Expand Up @@ -4,6 +4,7 @@
<title>Demo</title>
<link rel="stylesheet" type="text/css" href="http://jimliu.github.io/angular-ui-tree/dist/angular-ui-tree.min.css">
<link rel="stylesheet" type="text/css" href="http://jimliu.github.io/angular-ui-tree/css/demo.css">

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.4/angular.min.js"></script>
<script type="text/javascript" src="dist/angular-ui-tree.js"></script>
<script type="text/javascript">
Expand Down
10 changes: 7 additions & 3 deletions dist/angular-ui-tree.js
@@ -1,5 +1,5 @@
/**
* @license Angular UI Tree v2.0.2
* @license Angular UI Tree v2.0.3
* (c) 2010-2014. https://github.com/JimLiu/angular-ui-tree
* License: MIT
*/
Expand Down Expand Up @@ -737,9 +737,10 @@
// disable right click
return;
}
if (e.uiTreeDragging) { // event has already fired in other scope.
if (e.uiTreeDragging || (e.originalEvent && e.originalEvent.uiTreeDragging)) { // event has already fired in other scope.
return;
}

// the element which is clicked.
var eventElm = angular.element(e.target);
var eventScope = eventElm.scope();
Expand All @@ -760,7 +761,10 @@
eventElm = eventElm.parent();
}

e.uiTreeDragging = scope; // stop event bubbling
e.uiTreeDragging = true; // stop event bubbling
if (e.originalEvent) {
e.originalEvent.uiTreeDragging = true;
}
e.preventDefault();
var eventObj = $uiTreeHelper.eventObj(e);

Expand Down
4 changes: 2 additions & 2 deletions dist/angular-ui-tree.min.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions source/directives/uiTreeNode.js
Expand Up @@ -28,9 +28,10 @@
// disable right click
return;
}
if (e.uiTreeDragging) { // event has already fired in other scope.
if (e.uiTreeDragging || (e.originalEvent && e.originalEvent.uiTreeDragging)) { // event has already fired in other scope.
return;
}

// the element which is clicked.
var eventElm = angular.element(e.target);
var eventScope = eventElm.scope();
Expand All @@ -51,7 +52,10 @@
eventElm = eventElm.parent();
}

e.uiTreeDragging = scope; // stop event bubbling
e.uiTreeDragging = true; // stop event bubbling
if (e.originalEvent) {
e.originalEvent.uiTreeDragging = true;
}
e.preventDefault();
var eventObj = $uiTreeHelper.eventObj(e);

Expand Down
2 changes: 1 addition & 1 deletion source/main.js
@@ -1,5 +1,5 @@
/**
* @license Angular UI Tree v2.0.2
* @license Angular UI Tree v2.0.3
* (c) 2010-2014. https://github.com/JimLiu/angular-ui-tree
* License: MIT
*/
Expand Down

0 comments on commit 3ab9efb

Please sign in to comment.