+
-
-
+ placeholder="Consent" value="${consent.replace || 'Consent'}" data-consent="${consentKey}">
+
+
+
+
+
+
-
-
+
+
+
+
+
@@ -845,53 +906,43 @@
}
function updateIframeConsentsInput() {
+ console.log('json result', JSON.stringify(iframeConsents));
$('#iframe_consents').val(JSON.stringify(iframeConsents));
}
- // Add new iframe consent
- $('#add-iframe-consent').click(function() {
- iframeConsents.push({
- url: '',
- text: '',
- required: false,
- replace: 'Consent'
- });
- renderIframeConsents();
- });
-
- // Remove iframe consent
- $(document).on('click', '.remove-iframe-consent', function() {
- const index = $(this).data('index');
- iframeConsents.splice(index, 1);
- renderIframeConsents();
- });
-
// Update iframe consent values
$(document).on('input', '.iframe-consent-url', function() {
- const index = $(this).data('index');
+ const consentKey = $(this).data('consent');
const value = $(this).val();
- iframeConsents[index].url = value;
+ iframeConsents[consentKey].url = value;
updateIframeConsentsInput();
});
$(document).on('input', '.iframe-consent-text', function() {
- const index = $(this).data('index');
+ const consentKey = $(this).data('consent');
const value = $(this).val();
- iframeConsents[index].text = value;
+ iframeConsents[consentKey].text = value;
updateIframeConsentsInput();
});
$(document).on('input', '.iframe-consent-replace', function() {
- const index = $(this).data('index');
+ const consentKey = $(this).data('consent');
const value = $(this).val();
- iframeConsents[index].replace = value;
+ iframeConsents[consentKey].replace = value;
updateIframeConsentsInput();
});
$(document).on('change', '.iframe-consent-required', function() {
- const index = $(this).data('index');
+ const consentKey = $(this).data('consent');
const checked = $(this).is(':checked');
- iframeConsents[index].required = checked;
+ iframeConsents[consentKey].required = checked;
+ updateIframeConsentsInput();
+ });
+
+ $(document).on('change', '.iframe-consent-activated', function() {
+ const consentKey = $(this).data('consent');
+ const checked = $(this).is(':checked');
+ iframeConsents[consentKey].activated = checked;
updateIframeConsentsInput();
});
@@ -899,15 +950,20 @@
renderIframeOrigins();
renderIframeConsents();
- // Add at least one empty entry if none exist
+ // Add at least one empty entry if none exist for origins
if (iframeOrigins.length === 0) {
$('#add-iframe-origin').click();
}
- if (iframeConsents.length === 0) {
- $('#add-iframe-consent').click();
- }
+ // Handle collapse icon rotation
+ $('#iframe-consents-collapse').on('show.bs.collapse', function () {
+ $('#iframe-consents-icon').removeClass('fa-chevron-right').addClass('fa-chevron-down');
+ });
+
+ $('#iframe-consents-collapse').on('hide.bs.collapse', function () {
+ $('#iframe-consents-icon').removeClass('fa-chevron-down').addClass('fa-chevron-right');
+ });
});
-
+
\ No newline at end of file
diff --git a/Layout/default/VueViews/PreorderIFrame.php b/Layout/default/VueViews/PreorderIFrame.php
index 8059cb311..b867d1fdb 100644
--- a/Layout/default/VueViews/PreorderIFrame.php
+++ b/Layout/default/VueViews/PreorderIFrame.php
@@ -9,7 +9,9 @@
Bestellformular
-
+
+
+