Skip to content

Commit

Permalink
Fix dans le changeProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
yannis300307 committed Dec 15, 2024
1 parent 8b25ca0 commit d7d616b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions frontend/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,20 @@ function askSave() {
}

function changeProvider(element) {
/**
* Appelé par des calls dans le html lorsque l'utilisateur sélectionne un autre provider.
*/
let providersCombo = document.getElementById("alarm_providers_combo");
let centralProvidersCombo = document.getElementById("alarm_providers_combo_central");

let itemindex = element.selectedIndex
let providerValue = element.options[itemindex].value;
if (element == providersCombo) {
centralProvidersCombo.selectedIndex = itemindex;
}
if (element == centralProvidersCombo) {
providersCombo.selectedIndex = itemindex;
}
if (providerValue.toLowerCase() === "rick") { window.location = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"; return; }
window.alarmsProvider = providerValue;
updateAlarms();
Expand Down

0 comments on commit d7d616b

Please sign in to comment.