mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: add new plugin outlet 'after-header' (#26587)
* FEATURE: add new plugin outlet 'after-header' * Add to widget version * fix linting --------- Co-authored-by: David Taylor <david@taylorhq.com>
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import { getOwner } from "@ember/application";
|
||||
import { hash } from "@ember/helper";
|
||||
import { action } from "@ember/object";
|
||||
import { service } from "@ember/service";
|
||||
import { modifier } from "ember-modifier";
|
||||
import { and, eq, not, or } from "truth-helpers";
|
||||
import PluginOutlet from "discourse/components/plugin-outlet";
|
||||
import DAG from "discourse/lib/dag";
|
||||
import scrollLock from "discourse/lib/scroll-lock";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
@@ -218,6 +220,10 @@ export default class GlimmerHeader extends Component {
|
||||
{{/if}}
|
||||
</Contents>
|
||||
</div>
|
||||
<PluginOutlet
|
||||
@name="after-header"
|
||||
@outletArgs={{hash minimized=this.header.topic}}
|
||||
/>
|
||||
</header>
|
||||
</template>
|
||||
}
|
||||
|
||||
@@ -575,10 +575,23 @@ export default createWidget("header", {
|
||||
minimized: !!attrs.topic,
|
||||
};
|
||||
|
||||
return h(
|
||||
"div.wrap",
|
||||
this.attach("header-contents", { ...attrs, ...contentsAttrs })
|
||||
);
|
||||
return [
|
||||
h(
|
||||
"div.wrap",
|
||||
this.attach("header-contents", { ...attrs, ...contentsAttrs })
|
||||
),
|
||||
new RenderGlimmer(
|
||||
this,
|
||||
"div.widget-component-connector",
|
||||
hbs`
|
||||
<PluginOutlet
|
||||
@name="after-header"
|
||||
@outletArgs={{hash minimized=@data.minimized}}
|
||||
/>
|
||||
`,
|
||||
{ minimized: !!attrs.topic }
|
||||
),
|
||||
];
|
||||
},
|
||||
|
||||
updateHighlight() {
|
||||
|
||||
Reference in New Issue
Block a user