mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 23:40:38 +01:00
Fix a myriad of problems with the ACP/Plugins page
- Fixed #3350 - Fixed issue where the normalised API return would have the wrong id for all plugins - Fixed issue where uninstalling a locally installed plugin via ACP would cause NodeBB to crash - Simplified ACP/Plugins client-side code to simply refresh the page after installing or uninstalling a plugin.
This commit is contained in:
@@ -186,22 +186,7 @@ define('admin/extend/plugins', function() {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
|
||||
var targetList = (pluginData.installed ? 'installed' : 'download'),
|
||||
otherList = (pluginData.installed ? 'download' : 'installed'),
|
||||
payload = {};
|
||||
|
||||
payload[targetList] = pluginData;
|
||||
templates.parse('admin/partials/' + targetList + '_plugin_item', payload, function(html) {
|
||||
var pluginList = $('ul.' + targetList);
|
||||
|
||||
pluginList.append(html);
|
||||
$('ul.' + otherList).find('li[data-plugin-id="' + pluginID + '"]').slideUp('slow', function() {
|
||||
$(this).remove();
|
||||
$('html,body').animate({
|
||||
scrollTop: pluginList.find('li').last().offset().top - 48
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
ajaxify.refresh();
|
||||
|
||||
app.alert({
|
||||
alert_id: 'plugin_toggled',
|
||||
|
||||
Reference in New Issue
Block a user