Skip to content

Commit

Permalink
ncp-web: fix ncp-app selection
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Apr 4, 2018
1 parent 30da787 commit e559f74
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions ncp-web/ncp.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,21 @@ function switch_to_section( name )
selectedID = null;
}

function cfgreqReceive( result )
function cfgreqReceive( result, item )
{
var ret = $.parseJSON( result );
if ( ret.token )
$('#csrf-token').set( { value: ret.token } );

$('#details-box' ).hide();
switch_to_section( 'config' );
selectedID = item.get('.id');
item.set( '+active' );

$('#details-box' ).hide();
$('#circle-retstatus').hide();
$('#config-box').ht( ret.output );
$('#config-box-title' ).fill( $( '#' + selectedID + '-desc' ).get( '.value' ) );
$('#config-box-info-txt' ).fill( $( '#' + selectedID + '-info' ).get( '.value' ) );
switch_to_section( 'config' );
$('#config-box-wrapper').show();
$('#config-extra-info').set( { $display: 'inline-block' } );
$('#config-extra-info').up().set( '@href', 'https://github.com/nextcloud/nextcloudpi/wiki/Configuration-Reference#' + selectedID );
Expand Down Expand Up @@ -87,9 +90,7 @@ $(function()
csrf_token: $( '#csrf-token' ).get( '.value' ) }).then(
function success( result )
{
cfgreqReceive( result );
selectedID = that.get('.id');
that.set( '+active' );
cfgreqReceive( result, that );
confLock = false;
}).error( errorMsg );
});
Expand Down Expand Up @@ -171,11 +172,7 @@ $(function()
csrf_token: $( '#csrf-token' ).get( '.value' ) }).then(
function success( result )
{
selectedID = 'nc-update';
$( '#nc-update' ).set( '+active' );

cfgreqReceive( result );

cfgreqReceive( result, $( '#nc-update' ) );
confLock = false;
}
).error( errorMsg );
Expand Down

0 comments on commit e559f74

Please sign in to comment.