Skip to content

Commit

Permalink
fixed widget titles
Browse files Browse the repository at this point in the history
  • Loading branch information
hrueger committed Oct 30, 2020
1 parent 4783940 commit 7d99562
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/_components/widget-grid/widget-grid.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{ widget | json }}
</pre>-->
<div class="d-flex justify-content-between">
<span class="text-truncate" [title]='widget.displayName ? widget.displayName : (widget.type == "BlackoutButton" ? "Blackout" : widget.type == "MultiAction" ? "Multi Action Button" : ((editMode ? ((widget.type || (widget.effect | effectName)) + ": ") : "") + widget.channel + " - " + fixture.displayName))'>{{widget.displayName ? widget.displayName : (widget.type == "BlackoutButton" ? "Blackout" : widget.type == "MultiAction" ? "Multi Action Button" : ((editMode ? ((widget.type || (widget.effect | effectName)) + ": ") : "") + widget.channel + " - " + fixture.displayName))}}</span>
<span class="text-truncate" [title]="getWidgetTitle(fixture, widget)">{{getWidgetTitle(fixture, widget)}}</span>
<div class="item-buttons d-flex flex-nowrap" *ngIf="editMode">
<span [class]="'d-flex flex-nowrap text-' + (widget.config.transitionTime > 50 ? 'success' : 'warning')"><i class="far fa-play-circle mt-1"></i> {{widget.config.transitionTime ? widget.config.transitionTime / 1000 : 0}}s</span>
<button class="action-btn yellow ml-1 drag-handler">
Expand Down Expand Up @@ -163,7 +163,7 @@

<ng-template #configModal let-modal>
<div class="modal-header">
<h4 class="modal-title" id="modal-basic-title">Settings of <i>{{currentWidget.displayName ? currentWidget.displayName : ((currentWidget.type || (currentWidget.effect | effectName)) + ": " + currentWidget.channel + " - " + currentFixture.displayName)}}</i></h4>
<h4 class="modal-title" id="modal-basic-title">Settings of <i>{{getWidgetTitle(currentFixture, currentWidget)}}</i></h4>
<button type="button" class="close" (click)="modal.dismiss()"><span>&times;</span></button>
</div>
<div class="modal-body">
Expand Down
7 changes: 7 additions & 0 deletions src/app/_components/widget-grid/widget-grid.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,13 @@ export class WidgetGridComponent implements OnInit {
this.showService.save();
}

public getWidgetTitle(fixture: Fixture, widget: Widget): string {
if (widget.displayName) return widget.displayName;
if (widget.type == "BlackoutButton") return "Blackout";
if (widget.type == "MultiAction") return "Multi Action Button";
return `${this.editMode ? `${widget.type || widget.effect || "Effect"}: ` : ""}${widget.channel} - ${fixture.displayName}`;
}

public action(type: string, fixture: Fixture,
widget: Widget, event: Event | number | any, idx?: number): void {
if (this.editMode && !this.previewEnabled) {
Expand Down

0 comments on commit 7d99562

Please sign in to comment.