From ed6d5a55a56bc98f26b53fb57f5375e7090e2792 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 22 Sep 2020 14:33:26 -0400 Subject: [PATCH] put an onchange on the monitorType causing a form submit so that Source and Storage tabs update. Rename action to save and put it on the submit button --- web/includes/actions/monitor.php | 2 +- web/skins/classic/views/js/monitor.js | 7 +++++++ web/skins/classic/views/monitor.php | 7 +++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/web/includes/actions/monitor.php b/web/includes/actions/monitor.php index 50f0c20c1..b1a7d4726 100644 --- a/web/includes/actions/monitor.php +++ b/web/includes/actions/monitor.php @@ -24,7 +24,7 @@ if ( ! canEdit('Monitors') ) { return; } -if ( $action == 'monitor' ) { +if ( $action == 'save' ) { $mid = 0; if ( !empty($_REQUEST['mid']) ) { $mid = validInt($_REQUEST['mid']); diff --git a/web/skins/classic/views/js/monitor.js b/web/skins/classic/views/js/monitor.js index b9f37c090..5edc3d0e1 100644 --- a/web/skins/classic/views/js/monitor.js +++ b/web/skins/classic/views/js/monitor.js @@ -137,6 +137,13 @@ function initPage() { document.querySelectorAll('input[name="newMonitor[WebColour]"]').forEach(function(el) { el.onchange = window['change_WebColour'].bind(el); }); + document.querySelectorAll('select[name="newMonitor[Type]"]').forEach(function(el) { + el.onchange = function() { + var form = document.getElementById('contentForm'); + form.tab.value = 'general'; + form.submit(); + }; + }); $j('.chosen').chosen(); diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index 805769eb1..7f6abf791 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -460,9 +460,8 @@ if ( canEdit('Monitors') ) {
-
- - + +
@@ -1158,7 +1157,7 @@ echo htmlSelect('newMonitor[ReturnLocation]', $return_options, $monitor->ReturnL ?>
- +