File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 11( function ( angular ) {
22 'use strict' ;
3-
3+
44 angular . module ( 'treeControl' , [ ] )
55 . directive ( 'treecontrol' , [ '$compile' , function ( $compile ) {
66 /**
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" ,
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
269272 }
270273 }
271274 } ) ;
272- } ) ( angular ) ;
275+ } ) ( angular ) ;
You can’t perform that action at this time.
0 commit comments