From 8f753696ea2fa1dbe06ca17d64571cafb9bc0fe9 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Fri, 7 Aug 2015 13:30:29 -0700 Subject: [PATCH] Hiding Update button after an update or if there are none. Refreshing badges on sidebar after update. --- themes/grav/js/admin-all.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/themes/grav/js/admin-all.js b/themes/grav/js/admin-all.js index 3cec0a5c..50d4853f 100644 --- a/themes/grav/js/admin-all.js +++ b/themes/grav/js/admin-all.js @@ -127,6 +127,10 @@ $(function () { $('[data-gpm-grav]').remove(); toastr.success(result.message + window.grav_available_version); $('#footer .grav-version').html(window.grav_available_version); + + /*// hide the update button after successfull update and update the badges + $('[data-maintenance-update]').fadeOut(); + $('.badges.with-updates').removeClass('with-updates').find('.badge.updates').remove();*/ } else { toastr.success(result.message); } @@ -251,7 +255,10 @@ $(function () { UpdatesChart.update({series: [updated, missing]}); } - if (resources.total > 0) { + if (!resources.total) { + $('#updates [data-maintenance-update]').fadeOut(); + $('.badges.with-updates').removeClass('with-updates').find('.badge.updates').remove(); + } else { var length, icon = '', content = '{updates} of your {type} have an update available',