File tree 1 file changed +14
-8
lines changed
1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -41,20 +41,26 @@ if (hstr) {
41
41
}
42
42
setTheme ( ids [ 0 ] ) ;
43
43
}
44
- ids . forEach ( function ( id ) {
44
+ var makeDefault = function ( id ) {
45
45
if ( id !== 'meta' ) {
46
46
if ( components [ category ] [ id ] ) {
47
- var requireId = id ;
48
- while ( requireId && components [ category ] [ requireId ] && components [ category ] [ requireId ] . option !== 'default' ) {
49
- if ( typeof components [ category ] [ requireId ] === 'string' ) {
50
- components [ category ] [ requireId ] = { title : components [ category ] [ requireId ] }
47
+ if ( components [ category ] [ id ] . option !== 'default' ) {
48
+ if ( typeof components [ category ] [ id ] === 'string' ) {
49
+ components [ category ] [ id ] = { title : components [ category ] [ id ] }
51
50
}
52
- components [ category ] [ requireId ] . option = 'default' ;
53
- requireId = components [ category ] [ requireId ] . require ;
51
+ components [ category ] [ id ] . option = 'default' ;
52
+ }
53
+ if ( components [ category ] [ id ] . require ) {
54
+ var deps = components [ category ] [ id ] . require ;
55
+ if ( $u . type ( deps ) !== 'array' ) {
56
+ deps = [ deps ] ;
57
+ }
58
+ deps . forEach ( makeDefault ) ;
54
59
}
55
60
}
56
61
}
57
- } ) ;
62
+ } ;
63
+ ids . forEach ( makeDefault ) ;
58
64
}
59
65
} ) ;
60
66
}
You can’t perform that action at this time.
0 commit comments