From 3e5e46e7cb7e65e38250031012dfa2294409f3f3 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Wed, 19 May 2021 13:41:29 +0200 Subject: [PATCH] Updating label of buttons --- public/resources/job/add.js | 6 ++++++ templates/job/add.html.twig | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/public/resources/job/add.js b/public/resources/job/add.js index 5ea352a..4bf179d 100644 --- a/public/resources/job/add.js +++ b/public/resources/job/add.js @@ -17,6 +17,7 @@ function initCronType() { $('.crontype-item').on('click', function() { let type = $(this).data('type'); + $('#crontypeButton').html($(this).html()); $('.crontype').val(type); $('.crontype-inputs:not(.hidden)').addClass('hidden'); $('.crontype-' + type).removeClass('hidden'); @@ -28,6 +29,9 @@ function initCronType() $('.croncategory-group').addClass('btn-group'); $('.hosttype-group').removeClass('hidden'); } else { + let hosttypebtn = $('#hosttypeButton') + hosttypebtn.html(hosttypebtn.data('default-text')) + $('.croncategory-group').removeClass('btn-group'); $('.hosttype-group').addClass('hidden'); $('.hosttype-inputs').addClass('hidden'); @@ -40,6 +44,8 @@ function initCronType() function initHostType() { $('.hosttype-item').on('click', function() { + + $('#hosttypeButton').html($(this).html()); let type = $(this).data('type'); $('.hosttype').val(type); $('.hosttype-inputs:not(.hidden)').addClass('hidden'); diff --git a/templates/job/add.html.twig b/templates/job/add.html.twig index 737962f..371106c 100644 --- a/templates/job/add.html.twig +++ b/templates/job/add.html.twig @@ -39,7 +39,7 @@

Job details