Skip to content

Commit

Permalink
fixed orderBy to work with the new introduced bugs in angular 1.3.x a…
Browse files Browse the repository at this point in the history
…nd 1.4.x
  • Loading branch information
yoavaa committed Nov 9, 2015
1 parent 15319ce commit 961dd7f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion angular-tree-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,12 @@ if (typeof module !== "undefined" && typeof exports !== "undefined" && module.ex
};

//tree template
$scope.isReverse = function() {
return !($scope.reverseOrder === 'false' || $scope.reverseOrder === 'False' || $scope.reverseOrder === '' || $scope.reverseOrder === false);
};

var templateOptions = {
orderBy: $scope.orderBy ? ' | orderBy:orderBy:reverseOrder' : '',
orderBy: $scope.orderBy ? " | orderBy:'"+$scope.orderBy+"':isReverse()" : '',
ulClass: classIfDefined($scope.options.injectClasses.ul, true),
nodeChildren: $scope.options.nodeChildren,
liClass: classIfDefined($scope.options.injectClasses.li, true),
Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"karma.conf.js"
],
"dependencies": {
"angular": "~1.2.7"
"angular": "~1.4.4"
},
"devDependencies": {
"angular-mocks": "~1.2.7",
"angular-mocks": "~1.4.4",
"jquery": "~2.0.3",
"bootstrap": "~3.1.1",
"angular-bootstrap": "~0.11.0",
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,7 @@ <h1>Sorting tree nodes <small>(order-by, reserve-order)</small></h1>
function Sorting($scope) {
$scope.treedata=createSubTree(3, 4, "");
$scope.reverse = true;

}
</script>
</section>
Expand Down

0 comments on commit 961dd7f

Please sign in to comment.