Skip to content
Snippets Groups Projects
Commit bee1ddee authored by Xiao Gui's avatar Xiao Gui
Browse files

bugfix: iframe sandbox attr

bugfix: pureATPSelector edgecase
parent a114a843
No related branches found
No related tags found
No related merge requests found
<ng-template [ngIf]="selectedATP" let-ATP>
<!-- parcellation smart chip -->
<sxplr-smart-chip *ngIf="ATP.parcellation && parcAndGroup.length > 1"
[items]="parcAndGroup"
<sxplr-smart-chip *ngIf="ATP.parcellation && parcAndGroup && parcAndGroup.length > 1"
[items]="parcAndGroup || []"
[color]="colorPalette[2]"
[getChildren]="getChildren"
(itemClicked)="selectLeaf({ parcellation: $event })"
......@@ -44,8 +44,8 @@
</sxplr-smart-chip>
<!-- space smart chip -->
<sxplr-smart-chip *ngIf="ATP.template && availableTemplates.length > 1"
[items]="availableTemplates"
<sxplr-smart-chip *ngIf="ATP.template && availableTemplates && availableTemplates.length > 1"
[items]="availableTemplates || []"
[color]="colorPalette[1]"
(itemClicked)="selectLeaf({ template: $event })"
[elevation]="4"
......
......@@ -7,10 +7,17 @@ import { getUuid } from "src/util/fn";
import { WIDGET_PORTAL_TOKEN } from "src/widget/constants";
import { getPluginSrc, SET_PLUGIN_NAME } from "../const";
/**
* sandbox attribute must be set statically
* see https://angular.io/errors/NG0910
*/
@Component({
selector: 'sxplr-plugin-portal',
template: `
<iframe [src]="src | iframeSrc" [sandbox]="sandbox" #iframe>
<iframe [src]="src | iframeSrc"
sandbox="allow-downloads allow-popups allow-popups-to-escape-sandbox allow-scripts"
#iframe>
</iframe>
`,
styles: [
......@@ -21,13 +28,6 @@ import { getPluginSrc, SET_PLUGIN_NAME } from "../const";
export class PluginPortal implements AfterViewInit, OnDestroy, ListenerChannel{
sandbox = [
"allow-downloads",
"allow-popups",
"allow-popups-to-escape-sandbox",
"allow-scripts",
].join(" ")
@ViewChild('iframe', { read: ElementRef })
iframeElRef: ElementRef
src: string
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment