fix(menu): request base tag injection via gui param and fix preview base href
parent
4224af359b
commit
4c2867b1c4
|
|
@ -48,8 +48,8 @@ export class CreateMenuComponent implements OnInit {
|
|||
}
|
||||
|
||||
updateSafeUrl(): void {
|
||||
const url = `${this.baseUrl}/menu/${this.menuForm.get('publicUrl')?.value}`;
|
||||
if (url) {
|
||||
const url = `${this.baseUrl}/menu/${this.menuForm.get('publicUrl')?.value}?gui=1`;
|
||||
if (url && this.menuForm.get('publicUrl')?.value) {
|
||||
this.safeUrl = this.sanitizer.bypassSecurityTrustResourceUrl(url);
|
||||
} else {
|
||||
this.safeUrl = null;
|
||||
|
|
@ -122,8 +122,7 @@ export class CreateMenuComponent implements OnInit {
|
|||
this.dataService.previewMenuTemplate(base64Content).subscribe({
|
||||
next: (renderedHtml) => {
|
||||
// Ensure relative paths work in the data URL iframe by injecting a <base> tag
|
||||
const origin = new URL(this.baseUrl).origin;
|
||||
const baseTag = `<base href="${origin}/">`;
|
||||
const baseTag = `<base href="${this.baseUrl}/">`;
|
||||
|
||||
let finalHtml = renderedHtml;
|
||||
if (finalHtml.toLowerCase().includes('<head>')) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue