Skip to content

Commit

Permalink
v2.22.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Niels Dequeker committed Aug 19, 2017
1 parent b5248d3 commit c37b032
Show file tree
Hide file tree
Showing 7 changed files with 4,961 additions and 21 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,9 @@
# 2.22.6

* Fix broken headings in Markdown files [#936](https://github.com/angular-ui-tree/angular-ui-tree/issues/936)
* Prefer $timeout over safeApply [#964](https://github.com/angular-ui-tree/angular-ui-tree/issues/964)
* Leave empty placeholder in DOM until node is dropped [#910](https://github.com/angular-ui-tree/angular-ui-tree/issues/910)

# 2.22.5

* Move postinstall hook to pretest [#907](https://github.com/angular-ui-tree/angular-ui-tree/issues/907)
Expand Down
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "angular-ui-tree",
"version": "2.22.5",
"version": "2.22.6",
"homepage": "https://github.com/angular-ui-tree/angular-ui-tree",
"authors": [
"Jim Liu <https://github.com/JimLiu>",
Expand Down
21 changes: 5 additions & 16 deletions dist/angular-ui-tree.js
@@ -1,5 +1,5 @@
/**
* @license Angular UI Tree v2.22.5
* @license Angular UI Tree v2.22.6
* (c) 2010-2017. https://github.com/angular-ui-tree/angular-ui-tree
* License: MIT
*/
Expand Down Expand Up @@ -198,8 +198,8 @@

angular.module('ui.tree')

.controller('TreeNodesController', ['$scope', '$element',
function ($scope, $element) {
.controller('TreeNodesController', ['$scope', '$element', '$timeout',
function ($scope, $element, $timeout) {
this.scope = $scope;

$scope.$element = $element;
Expand Down Expand Up @@ -243,22 +243,11 @@
return $scope.$modelValue.length > 0;
};

$scope.safeApply = function (fn) {
var phase = this.$root.$$phase;
if (phase == '$apply' || phase == '$digest') {
if (fn && (typeof (fn) === 'function')) {
fn();
}
} else {
this.$apply(fn);
}
};

//Called in apply method of UiTreeHelper.dragInfo.
$scope.removeNode = function (node) {
var index = $scope.$modelValue.indexOf(node.$modelValue);
if (index > -1) {
$scope.safeApply(function () {
$timeout(function () {
$scope.$modelValue.splice(index, 1)[0];
});
return $scope.$treeScope.$callbacks.removed(node);
Expand All @@ -268,7 +257,7 @@

//Called in apply method of UiTreeHelper.dragInfo.
$scope.insertNode = function (index, nodeData) {
$scope.safeApply(function () {
$timeout(function () {
$scope.$modelValue.splice(index, 0, nodeData);
});
};
Expand Down
4 changes: 2 additions & 2 deletions dist/angular-ui-tree.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "angular-ui-tree",
"version": "2.22.5",
"version": "2.22.6",
"description": "An AngularJS UI component that can sort nested lists, provides drag & drop support and doesn't depend on jQuery",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion source/main.js
@@ -1,5 +1,5 @@
/**
* @license Angular UI Tree v2.22.5
* @license Angular UI Tree v2.22.6
* (c) 2010-2017. https://github.com/angular-ui-tree/angular-ui-tree
* License: MIT
*/
Expand Down

0 comments on commit c37b032

Please sign in to comment.