diff options
Diffstat (limited to 'src/client/views/pdf')
| -rw-r--r-- | src/client/views/pdf/AnchorMenu.tsx | 9 | ||||
| -rw-r--r-- | src/client/views/pdf/PDFViewer.tsx | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/client/views/pdf/AnchorMenu.tsx b/src/client/views/pdf/AnchorMenu.tsx index dcd76979f..31941a299 100644 --- a/src/client/views/pdf/AnchorMenu.tsx +++ b/src/client/views/pdf/AnchorMenu.tsx @@ -134,7 +134,7 @@ export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> { * Transfers the flashcard text generated by GPT on flashcards and creates a collection out them. */ - transferToFlashcard = (text: string) => { + transferToFlashcard = (text: string, x: number, y: number) => { // put each question generated by GPT on the front of the flashcard var senArr = text.trim().split('Question: '); var collectionArr: Doc[] = []; @@ -154,9 +154,10 @@ export class AnchorMenu extends AntimodeMenu<AntimodeMenuProps> { }); console.log(collectionArr); - newCol.x = this._x; - newCol.y = this._y; - newCol.zIndex = 100; + newCol.x = x; + newCol.y = y; + console.log(this._x); + newCol.zIndex = 1000; this.addToCollection?.(newCol); this._loading = false; diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index 1af7b1fc0..9d06f81ed 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -556,7 +556,7 @@ export class PDFViewer extends ObservableReactComponent<IViewerProps> { const res = await gptAPICall(queryText, GPTCallType.FLASHCARD); console.log(res); - AnchorMenu.Instance.transferToFlashcard(res || 'Something went wrong'); + AnchorMenu.Instance.transferToFlashcard(res || 'Something went wrong', NumCast(this._props.layoutDoc['x']), NumCast(this._props.layoutDoc['y'])); this._selectionText = ''; } catch (err) { console.error(err); |
