mirror of
https://github.com/discourse/discourse.git
synced 2024-12-23 18:03:44 +08:00
038e5deb2a
* `@ember/owner` instead of `@ember/application` * `discourse-i18n` instead of `I18n` * `{ service } from "@ember/service"` instead of `inject as service`
57 lines
1.7 KiB
Plaintext
57 lines
1.7 KiB
Plaintext
import Component from "@glimmer/component";
|
|
import { concat } from "@ember/helper";
|
|
import { service } from "@ember/service";
|
|
import { and } from "truth-helpers";
|
|
import DModal from "discourse/components/d-modal";
|
|
import concatClass from "discourse/helpers/concat-class";
|
|
import DFloatBody from "float-kit/components/d-float-body";
|
|
|
|
export default class DInlineFloat extends Component {
|
|
@service site;
|
|
|
|
<template>
|
|
{{#if @instance.expanded}}
|
|
{{#if (and this.site.mobileView @instance.options.modalForMobile)}}
|
|
<DModal
|
|
@closeModal={{@instance.close}}
|
|
@hideHeader={{true}}
|
|
data-identifier={{@instance.options.identifier}}
|
|
data-content
|
|
class={{concatClass
|
|
"fk-d-menu-modal"
|
|
(concat @instance.options.identifier "-content")
|
|
}}
|
|
>
|
|
{{#if @instance.options.component}}
|
|
<@instance.options.component
|
|
@data={{@instance.options.data}}
|
|
@close={{@instance.close}}
|
|
/>
|
|
{{else}}
|
|
{{@instance.options.content}}
|
|
{{/if}}
|
|
</DModal>
|
|
{{else}}
|
|
<DFloatBody
|
|
@instance={{@instance}}
|
|
@trapTab={{@trapTab}}
|
|
@mainClass={{@mainClass}}
|
|
@innerClass={{@innerClass}}
|
|
@role={{@role}}
|
|
@portalOutletElement={{@instance.portalOutletElement}}
|
|
@inline={{@inline}}
|
|
>
|
|
{{#if @instance.options.component}}
|
|
<@instance.options.component
|
|
@data={{@instance.options.data}}
|
|
@close={{@instance.close}}
|
|
/>
|
|
{{else}}
|
|
{{@instance.options.content}}
|
|
{{/if}}
|
|
</DFloatBody>
|
|
{{/if}}
|
|
{{/if}}
|
|
</template>
|
|
}
|