aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/collections/CollectionNoteTakingView.tsx47
-rw-r--r--src/client/views/collections/CollectionNoteTakingViewFieldColumn.tsx5
-rw-r--r--src/client/views/nodes/DocumentView.tsx10
3 files changed, 6 insertions, 56 deletions
diff --git a/src/client/views/collections/CollectionNoteTakingView.tsx b/src/client/views/collections/CollectionNoteTakingView.tsx
index 1e3a27d24..bfadfd99e 100644
--- a/src/client/views/collections/CollectionNoteTakingView.tsx
+++ b/src/client/views/collections/CollectionNoteTakingView.tsx
@@ -332,26 +332,6 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti
return Math.min(childHeight, maxHeight, panelHeight);
}
- // This following three functions must be from the view Mehek showed
- // columnDividerDown = (e: React.PointerEvent) => {
- // runInAction(() => this._cursor = "grabbing");
- // setupMoveUpEvents(this, e, this.onDividerMove, action(() => this._cursor = "grab"), emptyFunction);
- // }
-
- // @action
- // onDividerMove = (e: PointerEvent, down: number[], delta: number[]) => {
- // this.layoutDoc._columnWidth = Math.max(10, this.columnWidth + delta[0]);
- // return false;
- // }
-
- //TODO: currently unused. How can we make use of it?
- // @computed get columnDragger() {
- // return <div className="collectionNoteTakingView-columnDragger" onPointerDown={this.columnDividerDown} ref={this._draggerRef}
- // style={{ cursor: this._cursor, left: `${this.columnWidth + this.xMargin}px`, top: `${Math.max(0, this.yMargin - 9)}px` }} >
- // <FontAwesomeIcon icon={"arrows-alt-h"} />
- // </div>;
- // }
-
resizeColumns = (n: number) => {
//TODO: that isn't the proper width of columns
const totalWidth = this.PanelWidth
@@ -492,11 +472,8 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti
return true;
}
- // TODO: need this, but not using atm
@undoBatch
@action
- //What is the difference between internal and external drop?? Does internal mean we're dropping inside of a collection?
- // I take it back: external drop means we took it out of column/collection that we were just in
onExternalDrop = async (e: React.DragEvent): Promise<void> => {
const where = [e.clientX, e.clientY];
let targInd = -1;
@@ -523,7 +500,6 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti
headings = () => Array.from(this.Sections);
refList: any[] = [];
sectionNoteTaking = (heading: SchemaHeaderField | undefined, docList: Doc[]) => {
- // const key = this.pivotField;
const type = "number";
return <CollectionNoteTakingViewFieldColumn
unobserveHeight={ref => this.refList.splice(this.refList.indexOf(ref), 1)}
@@ -605,29 +581,6 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti
}
}
- //TODO: look at MultiRowResizer.tsx
- // @action
- // onDividerPointerDown = (e: React.PointerEvent) => {
- // const eles = HTMLElement[e.currentTarget.Elem]
- // DragManager.StartDrag(e.target, {}, e.clientX, e.clientY)
- // }
-
- // @action
- // onDividerPointerOver = (e: React.PointerEvent, index: number) => {
- // if (DragManager.docsBeingDragged.length == 0) {
- // //convert client X to how we're doing stuff
- // const xPos = e.clientX + 2 * this.xMargin
- // // get difference (-25 is because that's the center of the divider)
- // const xDividerPos = this.columnStartXCoords[index + 1] - 25
- // const diff = xDividerPos - xPos
- // // make a copy of the array
- // const colXCoords : number[] = []
- // this.columnStartXCoords.forEach(val => colXCoords.push(val))
- // colXCoords[index + 1] -= diff
- // this.columnStartXCoords = colXCoords
- // }
- // }
-
@action
setColumnStartXCoords = (movementX: number, colIndex: number) => {
const coords = [...this.columnStartXCoords]
diff --git a/src/client/views/collections/CollectionNoteTakingViewFieldColumn.tsx b/src/client/views/collections/CollectionNoteTakingViewFieldColumn.tsx
index 8b7461fc0..90196ff1c 100644
--- a/src/client/views/collections/CollectionNoteTakingViewFieldColumn.tsx
+++ b/src/client/views/collections/CollectionNoteTakingViewFieldColumn.tsx
@@ -7,7 +7,6 @@ import { Id } from "../../../fields/FieldSymbols";
import { RichTextField } from "../../../fields/RichTextField";
import { SchemaHeaderField } from "../../../fields/SchemaHeaderField";
import { ScriptField } from "../../../fields/ScriptField";
-import { NumCast } from "../../../fields/Types";
import { ImageField } from "../../../fields/URLField";
import { TraceMobx } from "../../../fields/util";
import { emptyFunction, returnEmptyString, setupMoveUpEvents } from "../../../Utils";
@@ -136,10 +135,6 @@ export class CollectionNoteTakingViewFieldColumn extends React.Component<CSVFiel
const key = this.props.pivotField;
const newDoc = Docs.Create.TextDocument(value, { _height: 18, _width: 200, _fitWidth: true, title: value, _autoHeight: true });
newDoc[key] = this.getValue(this.props.heading);
- // TODO not sure why we have all of this "maxHeading stuff"
- // const maxHeading = this.props.docList.reduce((maxHeading, doc) => NumCast(doc.heading) > maxHeading ? NumCast(doc.heading) : maxHeading, 0);
- // const heading = maxHeading === 0 || this.props.docList.length === 0 ? 1 : maxHeading === 1 ? 2 : 3;
- // newDoc.heading = heading;
FormattedTextBox.SelectOnLoad = newDoc[Id];
FormattedTextBox.SelectOnLoadChar = forceEmptyNote ? "" : " ";
return this.props.addDocument?.(newDoc) || false;
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 51820e77c..c0ee77e4e 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -412,10 +412,12 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps
startDragging(x: number, y: number, dropAction: dropActionType, hideSource = false) {
if (this._mainCont.current) {
const dragData = new DragManager.DocumentDragData([this.props.Document]);
- dragData.draggedDocuments.forEach((doc) => {
- doc.backgroundColor = "#C9DAEF"
- doc.opacity = 0.5
- })
+ if (this.props.isNoteTakingView) {
+ dragData.draggedDocuments.forEach((doc) => {
+ doc.backgroundColor = "#C9DAEF"
+ doc.opacity = 0.5
+ })
+ }
const [left, top] = this.props.ScreenToLocalTransform().scale(this.ContentScale).inverse().transformPoint(0, 0);
dragData.offset = this.props.ScreenToLocalTransform().scale(this.ContentScale).transformDirection(x - left, y - top);
dragData.dropAction = dropAction;