From 2b5e170c1bbca43ab804d7746a816715c490cc37 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Thu, 9 May 2019 20:37:59 -0400 Subject: simplified templates. made bullets always drag sub-bullets. --- src/client/views/Templates.tsx | 15 +++------------ src/client/views/nodes/DocumentView.tsx | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) (limited to 'src') 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, - `
` + export const Caption = new Template("Caption", TemplatePosition.OutterBottom, + `
` ); - - export const InnerCaption = new Template("Inner caption", TemplatePosition.InnerBottom, - `
{layout}
` - ); - - export const SideCaption = new Template("Side caption", TemplatePosition.OutterRight, - `
{layout}
` - ); - export const TitleOverlay = new Template("TitleOverlay", TemplatePosition.InnerTop, `
{layout}
@@ -72,7 +63,7 @@ export namespace Templates {
` ); - 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(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); -- cgit v1.2.3-70-g09d2