From 1bb613db5003e69dc17ad0d35fc02e2ffa275c6e Mon Sep 17 00:00:00 2001 From: bergware Date: Thu, 22 Mar 2018 15:02:23 +0100 Subject: [PATCH] Made "Update OS" list inline update without complete page reload --- plugins/dynamix.plugin.manager/Plugins.page | 4 ++-- plugins/dynamix.plugin.manager/Update.page | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/plugins/dynamix.plugin.manager/Plugins.page b/plugins/dynamix.plugin.manager/Plugins.page index a5752a415..f9c72c41a 100644 --- a/plugins/dynamix.plugin.manager/Plugins.page +++ b/plugins/dynamix.plugin.manager/Plugins.page @@ -43,9 +43,9 @@ function resize(bind) { function loadlist(id) { $.get('/plugins/dynamix.plugin.manager/include/ShowPlugins.php',{audit:id,check:},function(d) { var data = d.split(/\0/); + var list = $('#plugin_list'); if (id) { var cmd = id.split(':'); - var list = $('#plugin_list'); var tr = 'tr#'+cmd[0].replace(/[\. _]/g,''); switch (cmd[1]) { case 'return' : $('div.spinner').hide('slow');list.html(data[0]); $('#plugin_table').trigger('destroy'); break; @@ -54,7 +54,7 @@ function loadlist(id) { case 'install': if (!list.find(tr).length) list.append(data[0]).trigger('update'); break; } } else { - $('#plugin_list').html(data[0]); + list.html(data[0]); } if (data[1]>0) { $('#updateall').show(); diff --git a/plugins/dynamix.plugin.manager/Update.page b/plugins/dynamix.plugin.manager/Update.page index eeb4f8ca6..99ec7a6f6 100644 --- a/plugins/dynamix.plugin.manager/Update.page +++ b/plugins/dynamix.plugin.manager/Update.page @@ -51,29 +51,33 @@ function downgrade() { } function loadlist(id) { $.get('/plugins/dynamix.plugin.manager/include/ShowPlugins.php',{system:'true',audit:id,check:},function(data) { + var list = $('#os_list'); if (id) { - var tmp = id.split(':'); - var tr = 'tr#'+tmp[0].replace(/[\. _]/g,''); - switch (tmp[1]) { + var cmd = id.split(':'); + var tr = 'tr#'+cmd[0].replace(/[\. _]/g,''); + switch (cmd[1]) { + case 'return' : list.html(data); break; case 'update': - case 'install': $('#os_list').find(tr).remove(); $('#os_list').append(data).trigger('update'); break; + case 'install': $('#os_list').find(tr).remove(); $('#os_list').append(data); break; } } else { - $('#os_list').html(data); + list.html(data); } - $('#os_table').tablesorter({sortList:[[4,0],[1,0]],sortAppend:[[1,0]],headers:{0:{sorter:false},5:{sorter:false}},textAttribute:'data'}); $('#change_branch').prop('disabled',true); $('#previous').show(); + + + $('#checkos').prop('disabled',false); }); } $(function() { loadlist(); - $('.tabs').append(""); + $('.tabs').append(""); });