Fixed the bookmark manager for windowed mode

master
WolverinDEV 2021-03-14 19:50:45 +01:00
parent fc2ea02955
commit 95f4a7bfb7
6 changed files with 17 additions and 6 deletions

View File

@ -16,6 +16,11 @@
@include user-select(none);
&.windowed {
width: 100%;
height: 100%;
}
.inputBoxed {
height: 2em;
}

View File

@ -774,11 +774,11 @@ class ModalBookmarks extends AbstractModal {
this.variables.destroy();
}
renderBody(): React.ReactElement {
renderBody(renderBody): React.ReactElement {
return (
<EventContext.Provider value={this.events}>
<VariableContext.Provider value={this.variables}>
<div className={cssStyle.container}>
<div className={cssStyle.container + " " + (renderBody.windowed ? cssStyle.windowed : "")}>
<BookmarkListContainer />
<ContextDivider id={"separator-bookmarks"} direction={"horizontal"} defaultValue={25} />
<BookmarkInfoContainer />

View File

@ -57,6 +57,8 @@ export class ClientModalRenderer implements ModalRenderer {
headerClass={cssStyle.header}
headerTitleClass={cssStyle.title}
bodyClass={cssStyle.body}
windowed={true}
/>,
this.container,
() => {

View File

@ -48,7 +48,7 @@ class BodyRenderer {
this.modalInstance = instance;
if(this.modalInstance) {
ReactDOM.render(<>{this.modalInstance.renderBody()}</>, this.htmlContainer);
ReactDOM.render(<>{this.modalInstance.renderBody({ windowed: true })}</>, this.htmlContainer);
}
}
}

View File

@ -17,9 +17,11 @@ export const InternalModalContentRenderer = React.memo((props: {
headerTitleClass?: string,
bodyClass?: string,
refContent?: React.Ref<HTMLDivElement>
refContent?: React.Ref<HTMLDivElement>,
windowed: boolean,
}) => {
const body = useMemo(() => props.modal.renderBody(), [props.modal]);
const body = useMemo(() => props.modal.renderBody({ windowed: props.windowed }), [props.modal]);
const title = useMemo(() => props.modal.renderTitle(), [props.modal]);
return (
@ -87,6 +89,8 @@ export class InternalModalRenderer extends React.PureComponent<{ modal: Abstract
containerClass={cssStyle.contentInternal}
bodyClass={cssStyle.body + " " + cssStyle["modal-" + this.props.modal.color()]}
windowed={false}
/>
</div>
</div>

View File

@ -90,7 +90,7 @@ export interface ModalController {
export abstract class AbstractModal {
protected constructor() {}
abstract renderBody() : ReactElement;
abstract renderBody(properties: { windowed: boolean }) : ReactElement;
abstract renderTitle() : string | React.ReactElement;
/* only valid for the "inline" modals */