mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 18:43:44 +08:00
19 lines
407 B
JavaScript
19 lines
407 B
JavaScript
|
import Component from "@glimmer/component";
|
||
|
import { isTesting } from "discourse-common/config/environment";
|
||
|
|
||
|
export default class DFloatPortal extends Component {
|
||
|
<template>
|
||
|
{{#if this.inline}}
|
||
|
{{yield}}
|
||
|
{{else}}
|
||
|
{{#in-element @portalOutletElement}}
|
||
|
{{yield}}
|
||
|
{{/in-element}}
|
||
|
{{/if}}
|
||
|
</template>
|
||
|
|
||
|
get inline() {
|
||
|
return this.args.inline ?? isTesting();
|
||
|
}
|
||
|
}
|