From 5045913388f99fd7408a55972dfdb77f6a20aa0c Mon Sep 17 00:00:00 2001 From: Sanae Date: Tue, 4 Jun 2024 19:27:36 +0000 Subject: [PATCH] alert window works w button + uses new media field --- html/alert/addedit.html | 4 +--- html/alert/alert.html | 4 ++++ js/alert.js | 8 +++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/html/alert/addedit.html b/html/alert/addedit.html index e696d9e1..ecbb1fa1 100644 --- a/html/alert/addedit.html +++ b/html/alert/addedit.html @@ -7,7 +7,7 @@
- +
@@ -173,8 +173,6 @@
- - diff --git a/html/alert/alert.html b/html/alert/alert.html index 0b5a5bad..cccec200 100644 --- a/html/alert/alert.html +++ b/html/alert/alert.html @@ -26,4 +26,8 @@

Alerts

+

+ +

+ diff --git a/js/alert.js b/js/alert.js index f16e52be..805419cb 100644 --- a/js/alert.js +++ b/js/alert.js @@ -188,7 +188,7 @@ OB.Alert.saveAlert = function() else fields.stop = Math.round(stop_date.getTime()/1000)+''; fields.id = $('#alert_id').val(); - fields.item_id = $('#alert_item_id').val(); + fields.item_id = document.querySelector('#alert_item_id').value[0]; OB.API.post('alerts','save',fields,function(data) { @@ -239,10 +239,9 @@ OB.Alert.editAlert = function(id) } else $('#alert_duration').hide(); - $('#alert_item_info').text(emerg.item_name); $('#alert_name').val(emerg.name); $('#alert_frequency').val(emerg.frequency); - $('#alert_item_id').val(emerg.item_id); + document.querySelector('#alert_item_id').value = [emerg.item_id]; $('#alert_id').val(emerg.id); $('#alert_start_datetime').val(new Date(parseInt(emerg.start)*1000)); @@ -261,8 +260,7 @@ OB.Alert.addAlert = function(item_id,item_name,item_type) OB.Alert.addeditAlertWindow(); $('.edit_only').hide(); - $('#alert_item_id').val(item_id); - $('#alert_item_info').text(item_name); + document.querySelector('#alert_item_id').value = [item_id]; if(item_type=='image') $('#alert_duration').show(); else $('#alert_duration').hide();