Zeige das Widget Anfrage in der Vorschau des Seiteneditors und gib der Fassungsliste deutsche Texte
CI Feature / test (push) Successful in 5m32s
CI Feature / test (push) Successful in 5m32s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2eca612108
commit
374fd95576
7 files changed
+56
-4
No files matched your search
@@ -50,6 +50,10 @@ class InquiryWidget {
|
||||
this.active = null;
|
||||
this.sent = false;
|
||||
this.modal = this.config.open === 'modal';
|
||||
// In den Vorschau-Iframes des Seiteneditors (srcdoc, kleine feste Fläche) ist ein echter Dialog nicht darstellbar:
|
||||
// Dort steht der geöffnete Dialog als gerahmtes Beispiel unter dem Button. Auf der Seite und in der Seitenvorschau
|
||||
// öffnet der Button den echten Dialog.
|
||||
this.sample = this.modal && this.config.preview && Boolean(window.frameElement?.hasAttribute?.('srcdoc'));
|
||||
}
|
||||
|
||||
start() {
|
||||
@@ -64,6 +68,10 @@ class InquiryWidget {
|
||||
this.choose(preselected.key, false);
|
||||
}
|
||||
|
||||
if (this.sample) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.modal) {
|
||||
// Ein Button der Seite mit ?grund=… will den Dialog sofort sehen; ohne Vorwahl öffnet der Besucher selbst.
|
||||
if (preselected) {
|
||||
@@ -93,6 +101,18 @@ class InquiryWidget {
|
||||
}
|
||||
|
||||
this.root.classList.add('is-modal');
|
||||
|
||||
if (this.sample) {
|
||||
this.opener = h('button', { type: 'button', class: 'button iw-opener', text: this.config.openLabel });
|
||||
this.root.append(
|
||||
this.opener,
|
||||
h('p', { class: 'iw-sample-note', text: 'Vorschau: So sieht der geöffnete Dialog aus.' }),
|
||||
h('div', { class: 'iw-dialog iw-dialog--sample', role: 'group', 'aria-label': this.config.openLabel }, h('div', { class: 'iw-dialog-head' }, h('span', { class: 'iw-close', 'aria-hidden': 'true' }, '×')), this.body),
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
this.opener = h('button', {
|
||||
type: 'button',
|
||||
class: 'button iw-opener',
|
||||
|
||||
Reference in new issue
Block a user