Skip to content

Commit f24050e

Browse files
committed
committed the new fixes
1 parent e0acd13 commit f24050e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

angular-tree-control.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(function ( angular ) {
22
'use strict';
3-
3+
44
angular.module( 'treeControl', [] )
55
.directive( 'treecontrol', ['$compile', function( $compile ) {
66
/**
@@ -17,12 +17,12 @@
1717
else
1818
return "";
1919
}
20-
20+
2121
function ensureDefault(obj, prop, value) {
2222
if (!obj.hasOwnProperty(prop))
2323
obj[prop] = value;
2424
}
25-
25+
2626
return {
2727
restrict: 'EA',
2828
require: "treecontrol",
@@ -128,9 +128,12 @@
128128
else {
129129
if ($scope.selectedNode != selectedNode) {
130130
$scope.selectedNode = selectedNode;
131-
if ($scope.onSelection)
132-
$scope.onSelection({node: selectedNode});
133131
}
132+
else {
133+
$scope.selectedNode = undefined;
134+
}
135+
if ($scope.onSelection)
136+
$scope.onSelection({node: $scope.selectedNode});
134137
}
135138
};
136139

@@ -269,4 +272,4 @@
269272
}
270273
}
271274
});
272-
})( angular );
275+
})( angular );

0 commit comments

Comments
 (0)