mirror of
https://github.com/discourse/discourse.git
synced 2025-06-07 19:07:19 +08:00
DEV: adds chat-drawer-before-content plugin outlet (#28284)
This outlet is rendered before the content of the drawer. The `currentRouteName` is accessible in `outletArgs`. Example: ```gjs export default class Test extends Component { <template> {{#if (eq @outletArgs.currentRouteName "chat.browse")}} the browse page {{/if}} </template> } ```
This commit is contained in:
@ -11,6 +11,14 @@
|
|||||||
>
|
>
|
||||||
<div class="chat-drawer-container">
|
<div class="chat-drawer-container">
|
||||||
<div class="chat-drawer-resizer"></div>
|
<div class="chat-drawer-resizer"></div>
|
||||||
|
|
||||||
|
<PluginOutlet
|
||||||
|
@name="chat-drawer-before-content"
|
||||||
|
@outletArgs={{hash
|
||||||
|
currentRouteName=this.chatDrawerRouter.currentRouteName
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<this.chatDrawerRouter.component
|
<this.chatDrawerRouter.component
|
||||||
@params={{this.chatDrawerRouter.params}}
|
@params={{this.chatDrawerRouter.params}}
|
||||||
@openURL={{this.openURL}}
|
@openURL={{this.openURL}}
|
||||||
|
@ -160,6 +160,7 @@ export default class ChatDrawerRouter extends Service {
|
|||||||
@tracked component = null;
|
@tracked component = null;
|
||||||
@tracked drawerRoute = null;
|
@tracked drawerRoute = null;
|
||||||
@tracked params = null;
|
@tracked params = null;
|
||||||
|
@tracked currentRouteName = null;
|
||||||
|
|
||||||
routeNames = Object.keys(ROUTES);
|
routeNames = Object.keys(ROUTES);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user