Skip to content

Commit cfadd5d

Browse files
committed
Fixed bug in narrow width for #111
1 parent bdd0ea6 commit cfadd5d

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

src/app/app.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
</ion-header>
3535
<ion-content>
3636
<checkin-details [checkin]="checkin" [person]="person"
37-
[canSend]="checkin.canRespond(person)" [canResend]="checkin.canResend(person)"
38-
(sendClicked)="respondCheckin($event)" (resendClicked)="resendCheckin($event)" *ngIf="checkin"></checkin-details>
37+
[canRespond]="checkin.canRespond(person)" [canResend]="checkin.canResend(person)"
38+
(respondClicked)="respondCheckin($event)" (resendClicked)="resendCheckin($event)" *ngIf="checkin"></checkin-details>
3939
</ion-content>
4040
</ion-menu>
4141
<ion-nav main #content #rootNavController swipeBackEnabled="false" [root]="rootPage"></ion-nav>

src/components/checkin-details/checkin-details.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h1>{{checkin.message}}</h1>
77
<ion-badge color="waiting" *ngIf="checkin.waiting_count > 0">{{checkin.waiting_count}}</ion-badge>
88
</ion-item>
99
<ion-item text-wrap color="white">
10-
<button ion-button text-only item-left clear color="primary" tappable *ngIf="hasSendClicked && checkin.canRespond(person)" (click)="onSendClicked($event)">Respond</button>
10+
<button ion-button text-only item-left clear color="primary" tappable *ngIf="hasRespondClicked && checkin.canRespond(person)" (click)="onRespondClicked($event)">Respond</button>
1111
<button ion-button text-only item-right clear color="primary" tappable *ngIf="hasResendClicked && checkin.canResend(person)" (click)="onResendClicked($event)">Resend</button>
1212
</ion-item>
1313
</ion-list>

src/components/checkin-details/checkin-details.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,30 @@ export class CheckinDetailsComponent {
1616
person:Person;
1717

1818
@Input()
19-
canSend:boolean = false;
19+
canRespond:boolean = false;
2020

2121
@Input()
2222
canResend:boolean = false;
2323

2424
@Output()
25-
sendClicked = new EventEmitter();
25+
respondClicked = new EventEmitter();
2626

2727
@Output()
2828
resendClicked = new EventEmitter();
2929

30-
hasSendClicked:boolean = false;
30+
hasRespondClicked:boolean = false;
3131
hasResendClicked:boolean = false;
3232

3333
constructor() {
3434
}
3535

3636
ngOnInit() {
37-
this.hasSendClicked = this.sendClicked && this.sendClicked.observers.length > 0;
37+
this.hasRespondClicked = this.respondClicked && this.respondClicked.observers.length > 0;
3838
this.hasResendClicked = this.resendClicked && this.resendClicked.observers.length > 0;
3939
}
4040

41-
onSendClicked(event:any) {
42-
this.sendClicked.emit();
41+
onRespondClicked(event:any) {
42+
this.respondClicked.emit();
4343
}
4444

4545
onResendClicked(event:any) {

src/pages/checkin-details/checkin-details.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
<ion-refresher-content></ion-refresher-content>
1717
</ion-refresher>
1818
<checkin-details [checkin]="checkin" [person]="person"
19-
[canSend]="checkin.canRespond(person)" [canResend]="checkin.canResend(person)"
20-
(sendClicked)="respondCheckin($event)" (resendClicked)="resendCheckin($event)"></checkin-details>
19+
[canRespond]="checkin.canRespond(person)" [canResend]="checkin.canResend(person)"
20+
(respondClicked)="respondCheckin($event)" (resendClicked)="resendCheckin($event)" *ngIf="checkin && person"></checkin-details>
2121
</ion-content>

src/pages/checkin-list/checkin-list.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -417,14 +417,15 @@ export class CheckinListPage extends BasePage {
417417
}
418418

419419
private showCheckinDetails(checkin:Checkin, event:any=null) {
420-
if (this.platform.width() > this.WIDTH_LARGE) {
420+
if (document.body.clientWidth > this.WIDTH_LARGE) {
421421
// this.showModal(CheckinDetailsPage, {
422422
// organization: this.organization,
423423
// person: this.person,
424424
// checkin: checkin,
425425
// checkin_id: checkin.id,
426426
// modal: true
427427
// });
428+
// this.selected = checkin;
428429
this.events.publish('checkin:details', {
429430
checkin: checkin
430431
});

0 commit comments

Comments
 (0)