Files
discourse_theme_ran/javascripts/discourse/api-initializers/full-width-logo-behavior.js
T
Kris f1d5b69293 DEV: port full-width component to be included directly (#126)
Removes the [full-width
component](https://github.com/discourse/discourse-full-width-component)
dependency by adding most of the code directly to the theme. There was
one grid definition in the CSS I ended up removing because it was
conflicting with an existing override in the theme.

Anyone who has previously installed the theme should manually remove the
full-width component from it.
2025-04-11 15:46:25 -04:00

17 lines
440 B
JavaScript

import { apiInitializer } from "discourse/lib/api";
export default apiInitializer("0.8", (api) => {
document.body.classList.add("full-width-enabled");
// When the sidebar is visible, force the HomeLogo to be in an 'un-minimized' state.
api.registerValueTransformer?.(
"home-logo-minimized",
({ value, context }) => {
if (value && context.showSidebar) {
return false;
}
return value;
}
);
});