Parcourir la source

replaced reports page functionality with a new action button which does both moving and refreshing

master
Haku il y a 3 ans
Parent
révision
cd43fccc0d
2 fichiers modifiés avec 23 ajouts et 4 suppressions
  1. +10
    -4
      src/main.ts
  2. +13
    -0
      src/region.ts

+ 10
- 4
src/main.ts Voir le fichier

@@ -19,10 +19,16 @@ const keybinds: Keybind[] = [
functionName: 'move',
displayName: null,
callback: () => {
const moveButton: HTMLButtonElement =
document.querySelector('button[name=move_region]') as HTMLButtonElement;
if (moveButton)
moveButton.click();
if (urlParams['page'] === 'reports') {
const actionButton: HTMLInputElement = document.querySelector('#action');
if (actionButton)
actionButton.click();
} else {
const moveButton: HTMLButtonElement =
document.querySelector('button[name=move_region]') as HTMLButtonElement;
if (moveButton)
moveButton.click();
}
},
modifiedCallback: null
},


+ 13
- 0
src/region.ts Voir le fichier

@@ -0,0 +1,13 @@
(() =>
{
const moveButton: HTMLButtonElement = document.querySelector('button[name=move_region]');
if (moveButton) {
const localid = (document.querySelector('input[name=localid]') as HTMLInputElement).value;
moveButton.addEventListener('click', (e) =>
{
moveButton.disabled = true;
e.preventDefault();
window.location.href = `/template-overall=none/page=change_region?localid=${localid}&region_name=${urlParams['region']}&move_region=1`;
});
}
})();

Chargement…
Annuler
Enregistrer