From a97e526298d2aaa2173476d9bda7796f87413dfc Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Fri, 2 Oct 2020 16:10:32 -0500 Subject: [PATCH] fix save button in controlpreset modal --- web/ajax/modals/controlpreset.php | 4 ++-- web/includes/actions/control.php | 2 +- web/skins/classic/views/js/watch.js | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/web/ajax/modals/controlpreset.php b/web/ajax/modals/controlpreset.php index 22e8c73f7..775eeda33 100644 --- a/web/ajax/modals/controlpreset.php +++ b/web/ajax/modals/controlpreset.php @@ -38,7 +38,7 @@ for ( $i = 1; $i <= $monitor['NumPresets']; $i++ ) { -

+

@@ -46,7 +46,7 @@ for ( $i = 1; $i <= $monitor['NumPresets']; $i++ ) {

diff --git a/web/includes/actions/control.php b/web/includes/actions/control.php index 5c996e636..bf6db7967 100644 --- a/web/includes/actions/control.php +++ b/web/includes/actions/control.php @@ -36,6 +36,6 @@ if ( $action == 'control' ) { $ctrlCommand = buildControlCommand($monitor); $monitor->sendControlCommand($ctrlCommand); - $view = 'none'; + $redirect = $_SERVER['HTTP_REFERER']; } ?> diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index b0011d90b..3c4c03c59 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -816,7 +816,7 @@ function reloadWebSite() { } function updatePresetLabels() { - var form = $('contentForm'); + var form = $('ctrlPresetForm'); var preset_ddm = form.elements['preset']; var presetIndex = preset_ddm[preset_ddm.selectedIndex].value; @@ -836,6 +836,11 @@ function getCtrlPresetModal() { $j("body").append(data.html); } updatePresetLabels(); + // Manage the Save button + $j('#cPresetSubmitModal').click(function(evt) { + evt.preventDefault(); + $j('#ctrlPresetForm').submit(); + }); }) .fail(logAjaxFail); }