From ad4fff649c24258c7734d40de5bc059acd5951db Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 7 Oct 2014 13:08:28 -0400 Subject: [PATCH] closes #2234 --- public/src/forum/admin/extend/plugins.js | 8 ++++++-- src/views/admin/extend/plugins.tpl | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/public/src/forum/admin/extend/plugins.js b/public/src/forum/admin/extend/plugins.js index be7da462bf..22c178e2e8 100644 --- a/public/src/forum/admin/extend/plugins.js +++ b/public/src/forum/admin/extend/plugins.js @@ -34,19 +34,23 @@ define('forum/admin/extend/plugins', function() { pluginID = $(this).parents('li').attr('data-plugin-id'); var btn = $(this); + var activateBtn = btn.siblings('[data-action="toggleActive"]'); btn.html(btn.html() + 'ing') .attr('disabled', true) .find('i').attr('class', 'fa fa-refresh fa-spin'); socket.emit('admin.plugins.toggleInstall', pluginID, function(err, status) { - var activateBtn = $(''); + if (err) { + return app.alertError(err.message); + } if (status.installed) { btn.html(' Uninstall'); - activateBtn.insertBefore(btn); } else { btn.html(' Install'); + } + activateBtn.toggleClass('hidden', !status.installed); btn.toggleClass('btn-danger', status.installed).toggleClass('btn-success', !status.installed) .attr('disabled', false); diff --git a/src/views/admin/extend/plugins.tpl b/src/views/admin/extend/plugins.tpl index a0ccfb67be..643a07b786 100644 --- a/src/views/admin/extend/plugins.tpl +++ b/src/views/admin/extend/plugins.tpl @@ -36,6 +36,7 @@
  • +