Fixed the bookmark manager for windowed mode
This commit is contained in:
parent
fc2ea02955
commit
95f4a7bfb7
6 changed files with 17 additions and 6 deletions
|
@ -16,6 +16,11 @@
|
||||||
|
|
||||||
@include user-select(none);
|
@include user-select(none);
|
||||||
|
|
||||||
|
&.windowed {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.inputBoxed {
|
.inputBoxed {
|
||||||
height: 2em;
|
height: 2em;
|
||||||
}
|
}
|
||||||
|
|
|
@ -774,11 +774,11 @@ class ModalBookmarks extends AbstractModal {
|
||||||
this.variables.destroy();
|
this.variables.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
renderBody(): React.ReactElement {
|
renderBody(renderBody): React.ReactElement {
|
||||||
return (
|
return (
|
||||||
<EventContext.Provider value={this.events}>
|
<EventContext.Provider value={this.events}>
|
||||||
<VariableContext.Provider value={this.variables}>
|
<VariableContext.Provider value={this.variables}>
|
||||||
<div className={cssStyle.container}>
|
<div className={cssStyle.container + " " + (renderBody.windowed ? cssStyle.windowed : "")}>
|
||||||
<BookmarkListContainer />
|
<BookmarkListContainer />
|
||||||
<ContextDivider id={"separator-bookmarks"} direction={"horizontal"} defaultValue={25} />
|
<ContextDivider id={"separator-bookmarks"} direction={"horizontal"} defaultValue={25} />
|
||||||
<BookmarkInfoContainer />
|
<BookmarkInfoContainer />
|
||||||
|
|
|
@ -57,6 +57,8 @@ export class ClientModalRenderer implements ModalRenderer {
|
||||||
headerClass={cssStyle.header}
|
headerClass={cssStyle.header}
|
||||||
headerTitleClass={cssStyle.title}
|
headerTitleClass={cssStyle.title}
|
||||||
bodyClass={cssStyle.body}
|
bodyClass={cssStyle.body}
|
||||||
|
|
||||||
|
windowed={true}
|
||||||
/>,
|
/>,
|
||||||
this.container,
|
this.container,
|
||||||
() => {
|
() => {
|
||||||
|
|
|
@ -48,7 +48,7 @@ class BodyRenderer {
|
||||||
|
|
||||||
this.modalInstance = instance;
|
this.modalInstance = instance;
|
||||||
if(this.modalInstance) {
|
if(this.modalInstance) {
|
||||||
ReactDOM.render(<>{this.modalInstance.renderBody()}</>, this.htmlContainer);
|
ReactDOM.render(<>{this.modalInstance.renderBody({ windowed: true })}</>, this.htmlContainer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,11 @@ export const InternalModalContentRenderer = React.memo((props: {
|
||||||
headerTitleClass?: string,
|
headerTitleClass?: string,
|
||||||
bodyClass?: 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]);
|
const title = useMemo(() => props.modal.renderTitle(), [props.modal]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -87,6 +89,8 @@ export class InternalModalRenderer extends React.PureComponent<{ modal: Abstract
|
||||||
|
|
||||||
containerClass={cssStyle.contentInternal}
|
containerClass={cssStyle.contentInternal}
|
||||||
bodyClass={cssStyle.body + " " + cssStyle["modal-" + this.props.modal.color()]}
|
bodyClass={cssStyle.body + " " + cssStyle["modal-" + this.props.modal.color()]}
|
||||||
|
|
||||||
|
windowed={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -90,7 +90,7 @@ export interface ModalController {
|
||||||
export abstract class AbstractModal {
|
export abstract class AbstractModal {
|
||||||
protected constructor() {}
|
protected constructor() {}
|
||||||
|
|
||||||
abstract renderBody() : ReactElement;
|
abstract renderBody(properties: { windowed: boolean }) : ReactElement;
|
||||||
abstract renderTitle() : string | React.ReactElement;
|
abstract renderTitle() : string | React.ReactElement;
|
||||||
|
|
||||||
/* only valid for the "inline" modals */
|
/* only valid for the "inline" modals */
|
||||||
|
|
Loading…
Add table
Reference in a new issue