Skip to content

Commit

Permalink
Allow clicking on the entire width of the node title div
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokiterashima committed Oct 18, 2023
1 parent 6ac6da1 commit f2a98ef
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,20 @@
branchPathStepHeader: isNodeInAnyBranchPath(item.key) && !isGroupNode(item.key)
}"
[ngStyle]="{ 'background-color': getStepBackgroundColor(item.key) }"
(click)="nodeClicked(item.key)"
>
<mat-checkbox
color="primary"
[(ngModel)]="item.checked"
(ngModelChange)="selectNode()"
(click)="selectNode($event)"
[disabled]="
(isGroupNode(item.key) && stepNodeSelected) ||
(!isGroupNode(item.key) && groupNodeSelected)
"
aria-label="Select lesson or step"
i18n-aria-label
>
<div
class="projectItemTitleDiv"
fxLayoutAlign="start center"
fxLayoutGap="10px"
(click)="nodeClicked(item.key)"
>
<div class="projectItemTitleDiv" fxLayoutAlign="start center" fxLayoutGap="10px">
<node-icon-and-title [nodeId]="item.key" [showPosition]="true"></node-icon-and-title>
<p *ngIf="!isGroupNode(item.key)" fxLayoutAlign="start center" fxLayoutGap="10px">
<mat-icon
Expand Down Expand Up @@ -166,20 +162,17 @@ <h6 class="unused-header">Unused Lessons</h6>
isNodeInAnyBranchPath(inactiveNode.id) && !isGroupNode(inactiveNode.id)
}"
class="pointer projectItem"
(click)="nodeClicked(inactiveNode.id)"
>
<mat-checkbox
color="primary"
[(ngModel)]="inactiveNode.checked"
(ngModelChange)="selectNode()"
(click)="selectNode($event)"
[disabled]="stepNodeSelected"
aria-label="Select lesson"
i18n-aria-label
>
<div
class="projectItemTitleDiv"
fxLayoutAlign="start center"
(click)="nodeClicked(inactiveNode.id)"
>
<div class="projectItemTitleDiv" fxLayoutAlign="start center">
<node-icon-and-title [nodeId]="inactiveNode.id"></node-icon-and-title>
</div>
</mat-checkbox>
Expand All @@ -194,20 +187,17 @@ <h6 class="unused-header">Unused Lessons</h6>
isNodeInAnyBranchPath(inactiveChildId.id) && !isGroupNode(inactiveChildId.id)
}"
class="pointer projectItem"
(click)="nodeClicked(inactiveChildId)"
>
<mat-checkbox
color="primary"
[(ngModel)]="idToNode[inactiveChildId].checked"
(ngModelChange)="selectNode()"
(change)="selectNode($event)"
[disabled]="groupNodeSelected"
aria-label="Select step"
i18n-aria-label
>
<div
class="projectItemTitleDiv"
fxLayoutAlign="start center"
(click)="nodeClicked(inactiveChildId)"
>
<div class="projectItemTitleDiv" fxLayoutAlign="start center">
<node-icon-and-title [nodeId]="inactiveChildId"></node-icon-and-title>
</div>
</mat-checkbox>
Expand All @@ -231,20 +221,17 @@ <h6 class="unused-header" i18n>Unused Steps</h6>
branchPathStepHeader:
isNodeInAnyBranchPath(inactiveNode.id) && !isGroupNode(inactiveNode.id)
}"
(click)="nodeClicked(inactiveNode.id)"
>
<mat-checkbox
color="primary"
[(ngModel)]="inactiveNode.checked"
(ngModelChange)="selectNode()"
(click)="selectNode($event)"
[disabled]="groupNodeSelected"
aria-label="Select step"
i18n-aria-label
>
<div
class="projectItemTitleDiv"
fxLayoutAlign="start center"
(click)="nodeClicked(inactiveNode.id)"
>
<div class="projectItemTitleDiv" fxLayoutAlign="start center">
<node-icon-and-title [nodeId]="inactiveNode.id"></node-icon-and-title>
</div>
</mat-checkbox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class ProjectAuthoringComponent {
* The checkbox for a node was clicked. We do not allow selecting a mix of group and step nodes.
* If any group nodes are selected, disable all step node checkboxes, and vise-versa.
*/
protected selectNode(): void {
protected selectNode($event: Event): void {
const checkedNodes = this.items
.concat(Object.values(this.idToNode))
.filter((item) => item.checked);
Expand All @@ -204,6 +204,7 @@ export class ProjectAuthoringComponent {
this.groupNodeSelected = this.isGroupNode(checkedNodes[0].id);
this.stepNodeSelected = !this.groupNodeSelected;
}
$event.stopPropagation();
}

protected isBranchPoint(nodeId: string): boolean {
Expand Down
22 changes: 11 additions & 11 deletions src/messages.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -9622,7 +9622,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-authoring/project-authoring.component.html</context>
<context context-type="linenumber">157</context>
<context context-type="linenumber">153</context>
</context-group>
</trans-unit>
<trans-unit id="a10dba8eb1f22a5f90f90e79b8305963eec3ee38" datatype="html">
Expand All @@ -9637,7 +9637,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-authoring/project-authoring.component.html</context>
<context context-type="linenumber">220</context>
<context context-type="linenumber">210</context>
</context-group>
</trans-unit>
<trans-unit id="0217500199a3e48a7b95762b14b79dad49e76beb" datatype="html">
Expand All @@ -9652,7 +9652,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-authoring/project-authoring.component.html</context>
<context context-type="linenumber">221</context>
<context context-type="linenumber">211</context>
</context-group>
</trans-unit>
<trans-unit id="f951d80b53d5536f79142285e8ba09f190a3c723" datatype="html">
Expand Down Expand Up @@ -12039,7 +12039,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
<source>Select lesson or step</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-authoring/project-authoring.component.html</context>
<context context-type="linenumber">101</context>
<context context-type="linenumber">102</context>
</context-group>
</trans-unit>
<trans-unit id="8ee3a5c584c3f2988bbd4e7cf0204123f312fb0f" datatype="html">
Expand All @@ -12048,7 +12048,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
}}"/></source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-authoring/project-authoring.component.html</context>
<context context-type="linenumber">116,118</context>
<context context-type="linenumber">112,114</context>
</context-group>
</trans-unit>
<trans-unit id="3374b45efd7fad4f098ebbfb6a888d7236906a0c" datatype="html">
Expand All @@ -12057,7 +12057,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
}}"/></source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-authoring/project-authoring.component.html</context>
<context context-type="linenumber">126,128</context>
<context context-type="linenumber">122,124</context>
</context-group>
</trans-unit>
<trans-unit id="6a6a2c1fda09ebe6ab5a6a8313989c4cf4d8b194" datatype="html">
Expand All @@ -12066,32 +12066,32 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
}}"/></source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-authoring/project-authoring.component.html</context>
<context context-type="linenumber">136,138</context>
<context context-type="linenumber">132,134</context>
</context-group>
</trans-unit>
<trans-unit id="b3b4847175a6193afa85eb431bbe16d1f04470fa" datatype="html">
<source>Has Rubric</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-authoring/project-authoring.component.html</context>
<context context-type="linenumber">145</context>
<context context-type="linenumber">141</context>
</context-group>
</trans-unit>
<trans-unit id="6ab64ec395f796b771a2d87d2801d0fe60b871d2" datatype="html">
<source>Select lesson</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-authoring/project-authoring.component.html</context>
<context context-type="linenumber">175</context>
<context context-type="linenumber">172</context>
</context-group>
</trans-unit>
<trans-unit id="0788cea8f340f4f5399901765d2003f90af76669" datatype="html">
<source>Select step</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-authoring/project-authoring.component.html</context>
<context context-type="linenumber">203</context>
<context context-type="linenumber">197</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/project-authoring/project-authoring.component.html</context>
<context context-type="linenumber">240</context>
<context context-type="linenumber">231</context>
</context-group>
</trans-unit>
<trans-unit id="791981839110791639" datatype="html">
Expand Down

0 comments on commit f2a98ef

Please sign in to comment.