Skip to content

Commit

Permalink
New build
Browse files Browse the repository at this point in the history
  • Loading branch information
Niels Dequeker committed Aug 27, 2015
1 parent 738608f commit b4da660
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
37 changes: 24 additions & 13 deletions dist/angular-ui-tree.js
@@ -1,5 +1,5 @@
/**
* @license Angular UI Tree v2.8.0
* @license Angular UI Tree v2.9.0
* (c) 2010-2015. https://github.com/angular-ui-tree/angular-ui-tree
* License: MIT
*/
Expand Down Expand Up @@ -808,7 +808,7 @@
// Remove the placeholder
placeElm.remove();

// If the target was an empty tree, replace the emply element placeholder
// If the target was an empty tree, replace the empty element placeholder
if (treeScope) {
treeScope.resetEmptyElement();
treeScope = null;
Expand Down Expand Up @@ -1058,9 +1058,6 @@

if (ngModel) {
ngModel.$render = function () {
if (!ngModel.$modelValue || !angular.isArray(ngModel.$modelValue)) {
scope.$modelValue = [];
}
scope.$modelValue = ngModel.$modelValue;
};
}
Expand Down Expand Up @@ -1334,24 +1331,38 @@
* @returns {Object} Object with properties offsetX, offsetY, startX, startY, nowX and dirX.
*/
positionStarted: function (e, target) {
var pos = {};
pos.offsetX = e.pageX - this.offset(target).left;
pos.offsetY = e.pageY - this.offset(target).top;
pos.startX = pos.lastX = e.pageX;
pos.startY = pos.lastY = e.pageY;
var pos = {},
pageX = e.pageX,
pageY = e.pageY;

if (e.originalEvent && e.originalEvent.touches && (e.originalEvent.touches.length > 0)) {
pageX = e.originalEvent.touches[0].pageX;
pageY = e.originalEvent.touches[0].pageY;
}
pos.offsetX = pageX - this.offset(target).left;
pos.offsetY = pageY - this.offset(target).top;
pos.startX = pos.lastX = pageX;
pos.startY = pos.lastY = pageY;
pos.nowX = pos.nowY = pos.distX = pos.distY = pos.dirAx = 0;
pos.dirX = pos.dirY = pos.lastDirX = pos.lastDirY = pos.distAxX = pos.distAxY = 0;
return pos;
},

positionMoved: function (e, pos, firstMoving) {
var pageX = e.pageX,
pageY = e.pageY,
newAx;
if (e.originalEvent && e.originalEvent.touches && (e.originalEvent.touches.length > 0)) {
pageX = e.originalEvent.touches[0].pageX;
pageY = e.originalEvent.touches[0].pageY;
}
// mouse position last events
pos.lastX = pos.nowX;
pos.lastY = pos.nowY;

// mouse position this events
pos.nowX = e.pageX;
pos.nowY = e.pageY;
pos.nowX = pageX;
pos.nowY = pageY;

// distance mouse moved between events
pos.distX = pos.nowX - pos.lastX;
Expand All @@ -1366,7 +1377,7 @@
pos.dirY = pos.distY === 0 ? 0 : pos.distY > 0 ? 1 : -1;

// axis mouse is now moving on
var newAx = Math.abs(pos.distX) > Math.abs(pos.distY) ? 1 : 0;
newAx = Math.abs(pos.distX) > Math.abs(pos.distY) ? 1 : 0;

// do nothing on first move
if (firstMoving) {
Expand Down

0 comments on commit b4da660

Please sign in to comment.