diff options
author | Brice Maron <brice@bmaron.net> | 2012-05-14 21:52:40 +0000 |
---|---|---|
committer | Brice Maron <brice@bmaron.net> | 2012-05-14 21:52:40 +0000 |
commit | 97e8ff6801cdcdf356f868f40973a70527c0955e (patch) | |
tree | 6548e2d9baa10cd4d4e9396ddc9980a7a5f2a5bb /settings | |
parent | d4271ed9dfef9a31f34bf91b8d854cbc5be0c67d (diff) | |
download | nextcloud-server-97e8ff6801cdcdf356f868f40973a70527c0955e.tar.gz nextcloud-server-97e8ff6801cdcdf356f868f40973a70527c0955e.zip |
Switch enable button only when app is really installed or uninstalled
Diffstat (limited to 'settings')
-rw-r--r-- | settings/js/apps.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js index c15f0f30473..8aa54463b3b 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -34,6 +34,7 @@ $(document).ready(function(){ return false; }); $('#rightcontent input.enable').click(function(){ + var element = $(this); var app=$(this).data('appid'); var active=$(this).data('active'); if(app){ @@ -42,6 +43,12 @@ $(document).ready(function(){ if(!result || result.status!='success'){ OC.dialogs.alert('Error','Error while disabling app'); } + else { + element.data('active',false); + element.val(t('settings','Enable')); + var appData=$('#leftcontent li[data-id="'+app+'"]'); + appData.active=false; + } },'json'); $('#leftcontent li[data-id="'+app+'"]').removeClass('active'); }else{ @@ -49,14 +56,15 @@ $(document).ready(function(){ if(!result || result.status!='success'){ OC.dialogs.alert('Error','Error while enabling app'); } + else { + element.data('active',true); + element.val(t('settings','Disable')); + var appData=$('#leftcontent li[data-id="'+app+'"]'); + appData.active=true; + } },'json'); $('#leftcontent li[data-id="'+app+'"]').addClass('active'); } - active=!active; - $(this).data('active',active); - $(this).val((active)?t('settings','Disable'):t('settings','Enable')); - var appData=$('#leftcontent li[data-id="'+app+'"]'); - appData.active=active; } }); }); |