Skip to content

Commit

Permalink
DEV: Switch to new API to render into plugin outlet
Browse files Browse the repository at this point in the history
Why this change?

The `renderInOutlet` plugin API was introduced in Discourse core which
we will prefer to use going forward.
  • Loading branch information
tgxworld committed Oct 6, 2023
1 parent 2951c99 commit 97ee830
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion javascripts/discourse/api-initializers/init-search-banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ import { logSearchLinkClick } from "discourse/lib/search";
import { iconNode } from "discourse-common/lib/icon-library";
import { h } from "virtual-dom";
import I18n from "I18n";
import SearchBanner from "../components/search-banner";

export default apiInitializer("1.14.0", (api) => {
api.renderInOutlet(
settings.plugin_outlet === "above-main-container"
? "above-main-container"
: "below-site-header",
SearchBanner
);

export default apiInitializer("0.8", (api) => {
// Simplified version of header search theme component
const searchMenuWidget = api.container.factoryFor("widget:search-menu");
const corePanelContents = searchMenuWidget.class.prototype["panelContents"];
Expand Down

0 comments on commit 97ee830

Please sign in to comment.