@@ -27,18 +27,21 @@ function switch_to_section( name )
27
27
selectedID = null ;
28
28
}
29
29
30
- function cfgreqReceive ( result )
30
+ function cfgreqReceive ( result , item )
31
31
{
32
32
var ret = $ . parseJSON ( result ) ;
33
33
if ( ret . token )
34
34
$ ( '#csrf-token' ) . set ( { value : ret . token } ) ;
35
35
36
- $ ( '#details-box' ) . hide ( ) ;
36
+ switch_to_section ( 'config' ) ;
37
+ selectedID = item . get ( '.id' ) ;
38
+ item . set ( '+active' ) ;
39
+
40
+ $ ( '#details-box' ) . hide ( ) ;
37
41
$ ( '#circle-retstatus' ) . hide ( ) ;
38
42
$ ( '#config-box' ) . ht ( ret . output ) ;
39
43
$ ( '#config-box-title' ) . fill ( $ ( '#' + selectedID + '-desc' ) . get ( '.value' ) ) ;
40
44
$ ( '#config-box-info-txt' ) . fill ( $ ( '#' + selectedID + '-info' ) . get ( '.value' ) ) ;
41
- switch_to_section ( 'config' ) ;
42
45
$ ( '#config-box-wrapper' ) . show ( ) ;
43
46
$ ( '#config-extra-info' ) . set ( { $display : 'inline-block' } ) ;
44
47
$ ( '#config-extra-info' ) . up ( ) . set ( '@href' , 'https://github.com/nextcloud/nextcloudpi/wiki/Configuration-Reference#' + selectedID ) ;
@@ -87,9 +90,7 @@ $(function()
87
90
csrf_token : $ ( '#csrf-token' ) . get ( '.value' ) } ) . then (
88
91
function success ( result )
89
92
{
90
- cfgreqReceive ( result ) ;
91
- selectedID = that . get ( '.id' ) ;
92
- that . set ( '+active' ) ;
93
+ cfgreqReceive ( result , that ) ;
93
94
confLock = false ;
94
95
} ) . error ( errorMsg ) ;
95
96
} ) ;
@@ -171,11 +172,7 @@ $(function()
171
172
csrf_token : $ ( '#csrf-token' ) . get ( '.value' ) } ) . then (
172
173
function success ( result )
173
174
{
174
- selectedID = 'nc-update' ;
175
- $ ( '#nc-update' ) . set ( '+active' ) ;
176
-
177
- cfgreqReceive ( result ) ;
178
-
175
+ cfgreqReceive ( result , $ ( '#nc-update' ) ) ;
179
176
confLock = false ;
180
177
}
181
178
) . error ( errorMsg ) ;
0 commit comments