From 635c93dfcb1b41e5fca1c788ef6de9cc33f79e98 Mon Sep 17 00:00:00 2001 From: Splines Date: Wed, 15 May 2024 02:00:50 +0200 Subject: [PATCH] Fix structures cancel button (erdbeere) --- app/assets/javascripts/lectures.js | 5 +++++ app/views/lectures/edit/_structures.html.erb | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/lectures.js b/app/assets/javascripts/lectures.js index 7c43f8771..debd440f9 100644 --- a/app/assets/javascripts/lectures.js +++ b/app/assets/javascripts/lectures.js @@ -10,6 +10,11 @@ function loadExampleStructures() { $.ajax(Routes.edit_structures_path(lectureId), { type: "GET", dataType: "script", + complete: () => { + $("#erdbeere-structures-cancel").on("click", () => { + loadExampleStructures(); + }); + }, }); }; diff --git a/app/views/lectures/edit/_structures.html.erb b/app/views/lectures/edit/_structures.html.erb index 0931f3a70..8ff3c4b79 100644 --- a/app/views/lectures/edit/_structures.html.erb +++ b/app/views/lectures/edit/_structures.html.erb @@ -22,10 +22,8 @@
<%= f.submit t('buttons.save'), class: 'btn btn-sm btn-primary' %> - + <%= t('buttons.cancel') %>