Plugin manager handle edge case when plugin is already installed

This commit is contained in:
bergware
2018-03-08 20:06:24 +01:00
parent f2c632b854
commit 7c6dd9183e

View File

@@ -44,11 +44,12 @@ function loadlist(id) {
$.get('/plugins/dynamix.plugin.manager/include/ShowPlugins.php',{audit:id},function(data) {
if (id) {
var tmp = id.split(':');
var list = $('#plugin_list');
var tr = 'tr#'+tmp[0].replace(/[\. _]/g,'');
switch (tmp[1]) {
case 'remove' : $('#plugin_list').find(tr).remove(); break;
case 'update' : $('#plugin_list').find(tr).remove();
case 'install': $('#plugin_list').append(data).trigger('update'); break;
case 'remove' : list.find(tr).remove(); break;
case 'update' : list.find(tr).remove();
case 'install': if (!list.find(tr).length) list.append(data).trigger('update'); break;
}
} else {
$('#plugin_list').html(data);