File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 8
8
this . dropdownTreeService = dropdownTreeService ;
9
9
this . $element = $element ;
10
10
11
+ this . previousSelected = [ ] ;
12
+
11
13
if ( this . isFolder ( ) ) {
12
14
this . isOpen = this . dropdownTreeService
13
15
. shouldFolderBeOpen ( this . option , this . settings , this . selectedOptions ) ;
14
16
}
15
17
}
16
18
19
+ $doCheck ( ) {
20
+ if ( angular . isDefined ( this . selectedOptions ) &&
21
+ ! this . dropdownTreeService . areSameSelections ( this . selectedOptions , this . previousSelected ) &&
22
+ this . isFolder ( ) ) {
23
+ const newSelection = [ ] ;
24
+ this . selectedOptions . forEach ( ( selectedOption ) => {
25
+ if ( this . previousSelected . indexOf ( selectedOption ) < 0 ) {
26
+ newSelection . push ( selectedOption ) ;
27
+ }
28
+ } ) ;
29
+
30
+ this . getChildOptions ( ) . some ( ( childOption ) => {
31
+ if ( newSelection . indexOf ( childOption ) >= 0 ) {
32
+ this . isOpen = true ;
33
+ return true ;
34
+ }
35
+ return false ;
36
+ } ) ;
37
+
38
+ this . previousSelected = angular . extend ( [ ] , this . selectedOptions ) ;
39
+ }
40
+ }
41
+
17
42
getDisplayText ( ) {
18
43
return this . dropdownTreeService . getDisplayText ( this . option , this . settings ) ;
19
44
}
Original file line number Diff line number Diff line change 20
20
label : 'test child option c' ,
21
21
} ,
22
22
{
23
- name : 'f ' ,
23
+ name : 'fa ' ,
24
24
label : 'test child option f' ,
25
25
} ,
26
26
{
You can’t perform that action at this time.
0 commit comments