From 8a47edfdd3c89bce698fe2c8a6273e812a50f311 Mon Sep 17 00:00:00 2001 From: David Siegfried <david.siegfried@uni-vechta.de> Date: Fri, 1 Jul 2022 08:27:29 +0000 Subject: [PATCH] rvv2: dont move headline in booking-plan, closes #1236 Closes #1236 Merge request studip/studip!751 --- .../assets/javascripts/bootstrap/resources.js | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/resources/assets/javascripts/bootstrap/resources.js b/resources/assets/javascripts/bootstrap/resources.js index ec95163dbec..eec5ba1b56d 100644 --- a/resources/assets/javascripts/bootstrap/resources.js +++ b/resources/assets/javascripts/bootstrap/resources.js @@ -721,15 +721,14 @@ STUDIP.ready(function () { } ); - var nodes = jQuery('*.resource-plan[data-resources-fullcalendar="1"]'); - jQuery.each(nodes, function (index, node) { + jQuery('.resource-plan[data-resources-fullcalendar="1"]').each(function () { STUDIP.loadChunk('fullcalendar').then(() => { //Get the default date from the sessionStorage, if it is set //and no date is specified in the url. - var use_session_date = true; - var url_param_string = window.location.search; + let use_session_date = true; + let url_param_string = window.location.search; if (url_param_string) { - var url_params = new URLSearchParams(url_param_string); + let url_params = new URLSearchParams(url_param_string); if (url_params.get('defaultDate')) { use_session_date = false; } @@ -741,17 +740,17 @@ STUDIP.ready(function () { { loading: function (isLoading) { if (!isLoading) { - var h = jQuery('section.studip-fullcalendar-header'); + let h = jQuery('section.studip-fullcalendar-header'); if (h) { jQuery(h).removeClass('invisible'); - jQuery(h).insertAfter('.fc .fc-toolbar'); + jQuery(h).insertBefore(this); } } } } ); } else { - var config = { + let config = { studip_functions: { drop_event: STUDIP.Resources.dropEventInRoomGroupBookingPlan, @@ -760,16 +759,16 @@ STUDIP.ready(function () { }, loading: function (isLoading) { if (!isLoading) { - var h = jQuery('section.studip-fullcalendar-header'); + let h = jQuery('section.studip-fullcalendar-header'); if (h) { jQuery(h).removeClass('invisible'); - jQuery(h).insertAfter('.fc .fc-toolbar'); + jQuery(h).insertBefore(this); } } } }; if (use_session_date) { - var session_date_string = sessionStorage.getItem('booking_plan_date'); + let session_date_string = sessionStorage.getItem('booking_plan_date'); if (session_date_string) { config.defaultDate = session_date_string; } @@ -795,8 +794,8 @@ STUDIP.ready(function () { drop: function (event, ui_element) { event.preventDefault(); - var booking_plan_entry = event.target; - var new_background_colour = jQuery( + let booking_plan_entry = event.target; + let new_background_colour = jQuery( ui_element.helper ).css('background-color'); @@ -819,10 +818,10 @@ STUDIP.ready(function () { ); } }); - var h = jQuery('section.studip-fullcalendar-header').clone(); + let h = jQuery('section.studip-fullcalendar-header').clone(); if (h) { jQuery(h).removeClass('invisible'); - jQuery(h).insertAfter('.fc .fc-toolbar'); + jQuery(h).insertBefore(this); } } } -- GitLab