Skip to content

Commit a05f27a

Browse files
authored
Merge pull request #808 from mathematicalthinking/submissionsUpgrade
Submissions upgrade -- debugging creation of selections
2 parents 6549404 + d1a7b51 commit a05f27a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

app/components/selectable-area.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default class SelectableAreaComponent extends Component {
1212
@tracked currSubId = this.args.model?.id || null;
1313
@tracked selecting = this.args.makingSelection || false;
1414
@tracked showing = this.args.showingSelections || false;
15+
@tracked selections = [];
1516
currentSelections = null;
1617
imageTagging = null;
1718
selectionHighlighting = null;
@@ -26,12 +27,14 @@ export default class SelectableAreaComponent extends Component {
2627

2728
@action
2829
initializeSelectionTools() {
30+
console.log('Initializing selection tools...');
2931
if (this._toolsInitialized) return;
3032
this._toolsInitialized = true;
3133

3234
const containerId = 'submission_container';
3335
const scrollableContainer = 'al_submission';
3436
const container = document.getElementById(containerId);
37+
console.log('Container:', container);
3538

3639
if (!container) return;
3740

@@ -44,7 +47,10 @@ export default class SelectableAreaComponent extends Component {
4447
automaticEvent: !this.isTouchScreen,
4548
});
4649

50+
console.log('SelectionHighlighting:', this.selectionHighlighting);
51+
4752
this.selectionHighlighting.init((id) => {
53+
console.log('Selection created with ID:', id);
4854
const selection = this.selectionHighlighting.getSelection(id);
4955
selection.selectionType = 'selection';
5056
this.args.addSelection(selection);
@@ -67,6 +73,8 @@ export default class SelectableAreaComponent extends Component {
6773
this.imageTagging.loadTags(this.imgTags);
6874
this.imageTagging.enable();
6975

76+
console.log('about to load selections:', this.selections);
77+
7078
this.selectionHighlighting.loadSelections(this.selections);
7179

7280
if (this.args.showingSelections) {

app/components/workspace-submission.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
class='action_button new-response'
5959
{{on
6060
'click'
61-
(fn @toNewResponse @currentSubmission.id @currentWorkspace.id)
61+
(fn this.toNewResponse @currentSubmission.id @currentWorkspace.id)
6262
}}
6363
>Respond</button>
6464
{{#if this.submissionResponses.length}}

0 commit comments

Comments
 (0)