2021-01-14 11:20:13 +00:00
|
|
|
import {DocPageModel} from 'app/client/models/DocPageModel';
|
2021-01-19 09:28:07 +00:00
|
|
|
import {testId} from 'app/client/ui2018/cssVars';
|
|
|
|
import {dom, MultiHolder, Observable, styled} from 'grainjs';
|
2021-01-14 11:20:13 +00:00
|
|
|
|
|
|
|
|
2021-01-19 09:28:07 +00:00
|
|
|
export function createBottomBarDoc(owner: MultiHolder, pageModel: DocPageModel, leftPanelOpen: Observable<boolean>,
|
|
|
|
rightPanelOpen: Observable<boolean>) {
|
2021-01-14 11:20:13 +00:00
|
|
|
return dom.maybe(pageModel.gristDoc, (gristDoc) => (
|
2021-01-19 09:28:07 +00:00
|
|
|
cssPageName(
|
|
|
|
dom.text(gristDoc.currentPageName),
|
|
|
|
dom.on('click', () => { rightPanelOpen.set(false); leftPanelOpen.set(true); }),
|
|
|
|
testId('page-name'),
|
|
|
|
)
|
2021-01-14 11:20:13 +00:00
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
const cssPageName = styled('div', `
|
|
|
|
margin: 0 10px;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
2021-01-19 09:28:07 +00:00
|
|
|
cursor: pointer;
|
2021-01-14 11:20:13 +00:00
|
|
|
`);
|