summaryrefslogtreecommitdiff
path: root/src/client/scripts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-07-20 12:11:07 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-07-20 12:11:07 +0900
commitacb92442058fa2458967425efb7324ab0646a335 (patch)
treeafc2ac62a7bbddce5756fc49f1caba9f7cba5407 /src/client/scripts
parentMerge branch 'develop' (diff)
parent12.84.0 (diff)
downloadmisskey-acb92442058fa2458967425efb7324ab0646a335.tar.gz
misskey-acb92442058fa2458967425efb7324ab0646a335.tar.bz2
misskey-acb92442058fa2458967425efb7324ab0646a335.zip
Merge branch 'develop'
Diffstat (limited to 'src/client/scripts')
-rw-r--r--src/client/scripts/gen-search-query.ts2
-rw-r--r--src/client/scripts/get-user-menu.ts2
-rw-r--r--src/client/scripts/lookup-user.ts2
-rw-r--r--src/client/scripts/select-file.ts4
-rw-r--r--src/client/scripts/sticky-sidebar.ts16
5 files changed, 15 insertions, 11 deletions
diff --git a/src/client/scripts/gen-search-query.ts b/src/client/scripts/gen-search-query.ts
index a1db267123..cafb3cccfe 100644
--- a/src/client/scripts/gen-search-query.ts
+++ b/src/client/scripts/gen-search-query.ts
@@ -1,4 +1,4 @@
-import parseAcct from '@/misc/acct/parse';
+import { parseAcct } from '@/misc/acct';
import { host as localHost } from '@client/config';
export async function genSearchQuery(v: any, q: string) {
diff --git a/src/client/scripts/get-user-menu.ts b/src/client/scripts/get-user-menu.ts
index ceb2bfe173..3689a93b47 100644
--- a/src/client/scripts/get-user-menu.ts
+++ b/src/client/scripts/get-user-menu.ts
@@ -1,7 +1,7 @@
import { i18n } from '@client/i18n';
import copyToClipboard from '@client/scripts/copy-to-clipboard';
import { host } from '@client/config';
-import getAcct from '@/misc/acct/render';
+import { getAcct } from '@/misc/acct';
import * as os from '@client/os';
import { userActions } from '@client/store';
import { router } from '@client/router';
diff --git a/src/client/scripts/lookup-user.ts b/src/client/scripts/lookup-user.ts
index 269777d874..c393472ae8 100644
--- a/src/client/scripts/lookup-user.ts
+++ b/src/client/scripts/lookup-user.ts
@@ -1,4 +1,4 @@
-import parseAcct from '@/misc/acct/parse';
+import { parseAcct } from '@/misc/acct';
import { i18n } from '@client/i18n';
import * as os from '@client/os';
diff --git a/src/client/scripts/select-file.ts b/src/client/scripts/select-file.ts
index b8039fb670..9d7146e215 100644
--- a/src/client/scripts/select-file.ts
+++ b/src/client/scripts/select-file.ts
@@ -1,5 +1,6 @@
import * as os from '@client/os';
import { i18n } from '@client/i18n';
+import { defaultStore } from '@client/store';
export function selectFile(src: any, label: string | null, multiple = false) {
return new Promise((res, rej) => {
@@ -8,7 +9,7 @@ export function selectFile(src: any, label: string | null, multiple = false) {
input.type = 'file';
input.multiple = multiple;
input.onchange = () => {
- const promises = Array.from(input.files).map(file => os.upload(file));
+ const promises = Array.from(input.files).map(file => os.upload(file, defaultStore.state.uploadFolder));
Promise.all(promises).then(driveFiles => {
res(multiple ? driveFiles : driveFiles[0]);
@@ -57,6 +58,7 @@ export function selectFile(src: any, label: string | null, multiple = false) {
os.api('drive/files/upload-from-url', {
url: url,
+ folderId: defaultStore.state.uploadFolder,
marker
});
diff --git a/src/client/scripts/sticky-sidebar.ts b/src/client/scripts/sticky-sidebar.ts
index 18670bc037..c67b8f37ac 100644
--- a/src/client/scripts/sticky-sidebar.ts
+++ b/src/client/scripts/sticky-sidebar.ts
@@ -7,8 +7,9 @@ export class StickySidebar {
private isTop = false;
private isBottom = false;
private offsetTop: number;
+ private globalHeaderHeight: number = 59;
- constructor(container: StickySidebar['container'], marginTop = 0) {
+ constructor(container: StickySidebar['container'], marginTop = 0, globalHeaderHeight = 0) {
this.container = container;
this.el = this.container.children[0] as HTMLElement;
this.el.style.position = 'sticky';
@@ -16,30 +17,31 @@ export class StickySidebar {
this.container.prepend(this.spacer);
this.marginTop = marginTop;
this.offsetTop = this.container.getBoundingClientRect().top;
+ this.globalHeaderHeight = globalHeaderHeight;
}
public calc(scrollTop: number) {
if (scrollTop > this.lastScrollTop) { // downscroll
- const overflow = Math.max(0, (this.el.clientHeight + this.marginTop) - window.innerHeight);
+ const overflow = Math.max(0, this.globalHeaderHeight + (this.el.clientHeight + this.marginTop) - window.innerHeight);
this.el.style.bottom = null;
- this.el.style.top = `${-overflow + this.marginTop}px`;
+ this.el.style.top = `${-overflow + this.marginTop + this.globalHeaderHeight}px`;
this.isBottom = (scrollTop + window.innerHeight) >= (this.el.offsetTop + this.el.clientHeight);
if (this.isTop) {
this.isTop = false;
- this.spacer.style.marginTop = `${Math.max(0, this.lastScrollTop + this.marginTop - this.offsetTop)}px`;
+ this.spacer.style.marginTop = `${Math.max(0, this.globalHeaderHeight + this.lastScrollTop + this.marginTop - this.offsetTop)}px`;
}
} else { // upscroll
- const overflow = (this.el.clientHeight + this.marginTop) - window.innerHeight;
+ const overflow = this.globalHeaderHeight + (this.el.clientHeight + this.marginTop) - window.innerHeight;
this.el.style.top = null;
this.el.style.bottom = `${-overflow}px`;
- this.isTop = scrollTop <= this.el.offsetTop;
+ this.isTop = scrollTop + this.marginTop + this.globalHeaderHeight <= this.el.offsetTop;
if (this.isBottom) {
this.isBottom = false;
- this.spacer.style.marginTop = `${this.lastScrollTop + this.marginTop - this.offsetTop - overflow}px`;
+ this.spacer.style.marginTop = `${this.globalHeaderHeight + this.lastScrollTop + this.marginTop - this.offsetTop - overflow}px`;
}
}