Kaynağa Gözat

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

master
Haku 3 yıl önce
ebeveyn
işleme
cd43fccc0d
2 değiştirilmiş dosya ile 23 ekleme ve 4 silme
  1. +10
    -4
      src/main.ts
  2. +13
    -0
      src/region.ts

+ 10
- 4
src/main.ts Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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`;
});
}
})();

Yükleniyor…
İptal
Kaydet