diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-05-09 20:37:59 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-05-09 20:37:59 -0400 |
commit | 2b5e170c1bbca43ab804d7746a816715c490cc37 (patch) | |
tree | 0bf8c528b93e8dee7eb1894ee1fdd1d773c15dca /src | |
parent | 6691c55623fff5194b5fd1a830096e3925281301 (diff) |
simplified templates. made bullets always drag sub-bullets.
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/Templates.tsx | 15 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 2 |
2 files changed, 4 insertions, 13 deletions
diff --git a/src/client/views/Templates.tsx b/src/client/views/Templates.tsx index 02f9aa510..bbedc95f1 100644 --- a/src/client/views/Templates.tsx +++ b/src/client/views/Templates.tsx @@ -38,18 +38,9 @@ export class Template { export namespace Templates { // export const BasicLayout = new Template("Basic layout", "{layout}"); - export const OuterCaption = new Template("Outer caption", TemplatePosition.OutterBottom, - `<div id="screenSpace" style="margin-top: 100%; font-size:14px; background:yellow; width:100%; position:absolute"><FormattedTextBox {...props} fieldKey={"caption"} /></div>` + export const Caption = new Template("Caption", TemplatePosition.OutterBottom, + `<div id="screenSpace" style="top: 100%; font-size:14px; background:yellow; width:100%; position:absolute"><FormattedTextBox {...props} fieldKey={"caption"} /></div>` ); - - export const InnerCaption = new Template("Inner caption", TemplatePosition.InnerBottom, - `<div><div style="margin:auto; height:calc(100% - 50px); width:100%;">{layout}</div><div style="height:50px; width:100%; position:absolute"><FormattedTextBox {...props} fieldKey={"caption"}/></div></div>` - ); - - export const SideCaption = new Template("Side caption", TemplatePosition.OutterRight, - `<div><div style="margin:auto; height:100%; width:100%;">{layout}</div><div style="height:100%; width:300px; position:absolute; top: 0; right: -300px;"><FormattedTextBox {...props} fieldKey={"caption"}/></div> </div>` - ); - export const TitleOverlay = new Template("TitleOverlay", TemplatePosition.InnerTop, `<div><div style="height:100%; width:100%;position:absolute;">{layout}</div> <div style="height:25px; width:100%; position:absolute; top: 0; background-color: rgba(0, 0, 0, .4); color: white; "> @@ -72,7 +63,7 @@ export namespace Templates { </div>` ); - export const TemplateList: Template[] = [Title, TitleOverlay, OuterCaption, InnerCaption, SideCaption, Bullet]; + export const TemplateList: Template[] = [Title, TitleOverlay, Caption, Bullet]; export function sortTemplates(a: Template, b: Template) { if (a.Position < b.Position) { return -1; } diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 25a75904b..5aa74c703 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -176,7 +176,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu if (CollectionFreeFormView.RIGHT_BTN_DRAG && (e.button === 2 || (e.button === 0 && e.altKey)) && !this.isSelected()) { return; } - this._hitIsBullet = (e.target && (e.target as any).id === "isBullet"); + this._hitIsBullet = (e.target && (e.target as any).id === "isBullet") || Cast(this.props.Document.subBulletDocs, listSpec(Doc), []).filter(d => d).map(d => d as Doc).length > 0; if (e.shiftKey && e.buttons === 1) { if (this.props.isTopMost) { this.startDragging(e.pageX, e.pageY, e.altKey || e.ctrlKey ? "alias" : undefined, this._hitIsBullet); |