Skip to content

Commit b8d87ca

Browse files
Extracted chooseBackgroundImage to parent. Fixed typo label.textString -> label.text. #2895
1 parent 6c76e3f commit b8d87ca

5 files changed

Lines changed: 16 additions & 36 deletions

File tree

src/main/webapp/wise5/authoringTool/components/component-authoring.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ export abstract class ComponentAuthoring {
108108
});
109109
}
110110

111+
chooseBackgroundImage(): void {
112+
const params = {
113+
isPopup: true,
114+
nodeId: this.nodeId,
115+
componentId: this.componentId,
116+
target: 'background'
117+
};
118+
this.openAssetChooser(params);
119+
}
120+
111121
openAssetChooser(params: any): any {
112122
return this.ProjectAssetService.openAssetChooser(params).then((data: any) => {
113123
return this.assetSelected(data);

src/main/webapp/wise5/components/conceptMap/concept-map-authoring/concept-map-authoring.component.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,6 @@ export class ConceptMapAuthoring extends ComponentAuthoring {
156156
}
157157
}
158158

159-
chooseBackgroundImage(): void {
160-
const params = {
161-
isPopup: true,
162-
nodeId: this.nodeId,
163-
componentId: this.componentId,
164-
target: 'background'
165-
};
166-
this.openAssetChooser(params);
167-
}
168-
169159
chooseNodeImage(conceptMapNodeId: string): void {
170160
const params = {
171161
isPopup: true,

src/main/webapp/wise5/components/draw/draw-authoring/draw-authoring.component.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -176,16 +176,6 @@ export class DrawAuthoring extends ComponentAuthoring {
176176
this.componentChanged();
177177
}
178178

179-
chooseBackgroundImage(): void {
180-
const params = {
181-
isPopup: true,
182-
nodeId: this.nodeId,
183-
componentId: this.componentId,
184-
target: 'background'
185-
};
186-
this.openAssetChooser(params);
187-
}
188-
189179
chooseStampImage(stampIndex: number): void {
190180
const params = {
191181
isPopup: true,

src/main/webapp/wise5/components/label/label-authoring/label-authoring.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
<span i18n class="starter-labels-button-label">Starter Labels</span>
100100
<button mat-raised-button
101101
color="primary"
102-
(click)="addLabelClicked()"
102+
(click)="addLabel()"
103103
matTooltip="Add Starter Label"
104104
matTooltipPosition="above"
105105
i18n-matTooltip
@@ -199,7 +199,7 @@
199199
<span fxFlex></span>
200200
<button mat-raised-button
201201
color="primary"
202-
(click)="deleteLabelClicked(labelIndex, label)"
202+
(click)="deleteLabel(labelIndex, label)"
203203
matTooltip="Delete Label"
204204
matTooltipPosition="above"
205205
i18n-matTooltip
@@ -233,4 +233,4 @@
233233
i18n-aria-label>
234234
<mat-icon>delete_sweep</mat-icon>
235235
</button>
236-
</div>
236+
</div>

src/main/webapp/wise5/components/label/label-authoring/label-authoring.component.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class LabelAuthoring extends ComponentAuthoring {
5959
this.textInputChangeSubscription.unsubscribe();
6060
}
6161

62-
addLabelClicked(): void {
62+
addLabel(): void {
6363
const newLabel = {
6464
text: $localize`Enter text here`,
6565
color: 'blue',
@@ -74,23 +74,13 @@ export class LabelAuthoring extends ComponentAuthoring {
7474
this.componentChanged();
7575
}
7676

77-
deleteLabelClicked(index: number, label: any): void {
78-
if (confirm($localize`Are you sure you want to delete this label?\n\n${label.textString}`)) {
77+
deleteLabel(index: number, label: any): void {
78+
if (confirm($localize`Are you sure you want to delete this label?\n\n${label.text}`)) {
7979
this.authoringComponentContent.labels.splice(index, 1);
8080
this.componentChanged();
8181
}
8282
}
8383

84-
chooseBackgroundImage(): void {
85-
const params = {
86-
isPopup: true,
87-
nodeId: this.nodeId,
88-
componentId: this.componentId,
89-
target: 'background'
90-
};
91-
this.openAssetChooser(params);
92-
}
93-
9484
assetSelected({ nodeId, componentId, assetItem, target }): void {
9585
super.assetSelected({ nodeId, componentId, assetItem, target });
9686
const fileName = assetItem.fileName;

0 commit comments

Comments
 (0)