aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionStackingView.tsx
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-06 05:11:18 +0800
committerGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2020-08-06 05:11:18 +0800
commitfa0b28c300416621dec25407484fc2606a736e2a (patch)
tree61baaa7197c80ed23da6c12b70a5202557598bfc /src/client/views/collections/CollectionStackingView.tsx
parent917deb0c0d73997f4ffa465e75ac05fdca7a8519 (diff)
automatic text progressivize, ui changes, bug fixes
Diffstat (limited to 'src/client/views/collections/CollectionStackingView.tsx')
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index e00bdb065..fe3d57bdb 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -184,7 +184,7 @@ export class CollectionStackingView extends CollectionSubView(StackingDocument)
if (found) {
const top = found.getBoundingClientRect().top;
const localTop = this.props.ScreenToLocalTransform().transformPoint(0, top);
- smoothScroll(doc.presTransition ? Number(doc.presTransition) : 500, this._mainCont!, localTop[1] + this._mainCont!.scrollTop);
+ smoothScroll(doc.presTransition || doc.presTransition === 0 ? NumCast(doc.presTransition) : 500, this._mainCont!, localTop[1] + this._mainCont!.scrollTop);
}
afterFocus && setTimeout(() => {
if (afterFocus?.()) { }
@@ -291,20 +291,19 @@ export class CollectionStackingView extends CollectionSubView(StackingDocument)
const docs = this.childDocList;
if (docs) {
newDocs.map((doc, i) => {
+ console.log(doc.title);
if (i === 0) {
if (targInd === -1) targInd = docs.length;
else targInd = docs.indexOf(this.filteredChildren[targInd]);
const srcInd = docs.indexOf(doc);
docs.splice(srcInd, 1);
docs.splice((targInd > srcInd ? targInd - 1 : targInd) + plusOne, 0, doc);
- } else {
+ } else if (i < (newDocs.length / 2)) { //glr: for some reason dragged documents are duplicated
if (targInd === -1) targInd = docs.length;
- else targInd = docs.indexOf(this.filteredChildren[targInd]);
+ else targInd = docs.indexOf(newDocs[0]) + 1;
const srcInd = docs.indexOf(doc);
- const firstInd = docs.indexOf(newDocs[0]);
docs.splice(srcInd, 1);
- // docs.splice((targInd > srcInd ? targInd - 1 : targInd) + plusOne, 0, doc);
- docs.splice(firstInd + 1, 0, doc);
+ docs.splice((targInd > srcInd ? targInd - 1 : targInd) + plusOne, 0, doc);
}
});
}
@@ -312,6 +311,7 @@ export class CollectionStackingView extends CollectionSubView(StackingDocument)
}
return false;
}
+
@undoBatch
@action
onExternalDrop = async (e: React.DragEvent): Promise<void> => {