diff options
| author | Moritz Strohm <strohm@data-quest.de> | 2025-09-01 13:05:18 +0000 |
|---|---|---|
| committer | Moritz Strohm <strohm@data-quest.de> | 2025-09-01 13:05:18 +0000 |
| commit | 5079ef1560064aaf3a41b9b17bdfc23299b94791 (patch) | |
| tree | 58cbaba73edea5407b87aaea7fac7d54c6d73fb0 /resources/assets/javascripts/lib | |
| parent | c5e52e2065d4670d33e246611dcbbdfd19dbc1d2 (diff) | |
added code for displaying more than one icon for a resource booking in the booking plan, fixes #1726issue-5869
Closes #1726
Merge request studip/studip!4421
Diffstat (limited to 'resources/assets/javascripts/lib')
| -rw-r--r-- | resources/assets/javascripts/lib/fullcalendar.js | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/resources/assets/javascripts/lib/fullcalendar.js b/resources/assets/javascripts/lib/fullcalendar.js index e1174bd..809ac95 100644 --- a/resources/assets/javascripts/lib/fullcalendar.js +++ b/resources/assets/javascripts/lib/fullcalendar.js @@ -599,18 +599,24 @@ class Fullcalendar } if (event.extendedProps.icon) { - //Check if the icon is already an URL or just the name of an icon. - let iconUrl = ''; - if (event.extendedProps.icon.includes('://')) { - //The icon already is an URL. - iconUrl = event.extendedProps.icon; - } else { - //The icon is just referenced by its name. We do not need a specific color here, background-color is currentColor. - iconUrl = `${STUDIP.ASSETS_URL}images/icons/black/${event.extendedProps.icon}.svg` + //Check if there is more than one icon: + let event_icons = event.extendedProps.icon.split(','); + let title = $(eventElement).find('.fc-title'); + for (let icon of event_icons) { + //Check if the icon is already a URL or just the name of an icon. + let iconUrl = ''; + if (icon.includes('://')) { + //The icon is already a URL. + iconUrl = icon; + } else { + //The icon is just referenced by its name. We do not need a specific color here, background-color is currentColor. + iconUrl = `${STUDIP.ASSETS_URL}images/icons/black/${icon}.svg` + } + //Add the icons as spans in front of the content: + let icon_element = $('<span class="icon"></span>'); + icon_element.css('--icon-url', `url('${iconUrl}')`); + title.prepend(icon_element); } - const $title = $(eventElement).find('.fc-title'); - $title.addClass('has-icon'); - $title.css('--icon-url', `url('${iconUrl}')`); } }, eventSourceSuccess: function(content) { |
