From cf3fc97202588e835ade5d6ab1a3c087e46958ad Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 11 Jul 2020 10:13:11 +0900 Subject: Deck (#6504) * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip --- src/client/scripts/form.ts | 26 ++++++++++++++++++++++++++ src/client/scripts/paging.ts | 2 +- src/client/scripts/scroll.ts | 4 ++-- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 src/client/scripts/form.ts (limited to 'src/client/scripts') diff --git a/src/client/scripts/form.ts b/src/client/scripts/form.ts new file mode 100644 index 0000000000..3cf062be2a --- /dev/null +++ b/src/client/scripts/form.ts @@ -0,0 +1,26 @@ +export type FormItem = { + label?: string; + type: 'string'; + default: string | null; + hidden?: boolean; + multiline?: boolean; +} | { + label?: string; + type: 'number'; + default: number | null; + hidden?: boolean; + step?: number; +} | { + label?: string; + type: 'boolean'; + default: boolean | null; + hidden?: boolean; +} | { + label?: string; + type: 'enum'; + default: string | null; + hidden?: boolean; + enum: string[]; +}; + +export type Form = Record; diff --git a/src/client/scripts/paging.ts b/src/client/scripts/paging.ts index 1f302753e1..8efff7aa41 100644 --- a/src/client/scripts/paging.ts +++ b/src/client/scripts/paging.ts @@ -13,7 +13,7 @@ export default (opts) => ({ moreFetching: false, inited: false, more: false, - backed: false, + backed: false, // 遡り中か否か isBackTop: false, ilObserver: new IntersectionObserver( (entries) => entries.some((entry) => entry.isIntersecting) diff --git a/src/client/scripts/scroll.ts b/src/client/scripts/scroll.ts index 76881bbde1..f32e50cdc7 100644 --- a/src/client/scripts/scroll.ts +++ b/src/client/scripts/scroll.ts @@ -1,7 +1,7 @@ export function getScrollContainer(el: Element | null): Element | null { if (el == null || el.tagName === 'BODY') return null; - const style = window.getComputedStyle(el); - if (style.getPropertyValue('overflow') === 'auto') { + const overflow = window.getComputedStyle(el).getPropertyValue('overflow'); + if (overflow.endsWith('auto')) { // xとyを個別に指定している場合、hidden auto みたいな値になる return el; } else { return getScrollContainer(el.parentElement); -- cgit v1.2.3-freya