Skip to content

Commit

Permalink
Merge pull request #12 from adrianbj/pw-upgrades-auto-refresh
Browse files Browse the repository at this point in the history
Always refresh PW Upgrades list when loading.
  • Loading branch information
BernhardBaumrock authored May 18, 2024
2 parents 22032be + 81e9aae commit 87e50a8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tweaks/Modules/UpgradesRefresh/UpgradesRefresh.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
document.addEventListener("DOMContentLoaded", function() {
var upgrades_url = ProcessWire.config.urls.admin + 'setup/upgrades/';
$('a[href="' + upgrades_url + '"]').attr('href', upgrades_url + 'refresh');
});
21 changes: 21 additions & 0 deletions tweaks/Modules/UpgradesRefresh/UpgradesRefresh.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace RockAdminTweaks;

/**
* Thanks to Robin Sallis (@Toutouwai)
*/
class UpgradesRefresh extends Tweak
{
public function info(): array
{
return [
'description' => 'Always refresh when visiting ProcessWireUpgrades',
];
}

public function ready(): void
{
$this->loadJS();
}
}

0 comments on commit 87e50a8

Please sign in to comment.