File tree 10 files changed +81
-26
lines changed
10 files changed +81
-26
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,11 @@ import { Person } from '../../models/person';
24
24
} )
25
25
export class BasePage {
26
26
27
+ protected WIDTH_SMALL :number = 540 ;
28
+ protected WIDTH_MEDIUM :number = 720 ;
29
+ protected WIDTH_LARGE :number = 960 ;
30
+ protected WIDTH_EXTRA_LARGE :number = 1140 ;
31
+
27
32
protected offline :boolean = false ;
28
33
protected tablet :boolean = false ;
29
34
protected mobile :boolean = false ;
Original file line number Diff line number Diff line change 1
1
< ion-header >
2
2
< ion-navbar color ="navbar ">
3
- < button ion-button icon-only menuToggle color =" primary ">
4
- < ion-icon name =" menu " > </ ion-icon >
5
- </ button >
3
+ < ion-buttons left *ngIf =" modal == true ">
4
+ < button ion-button color =" primary " (click) =" closeModal($event) " > Close </ button >
5
+ </ ion-buttons >
6
6
< ion-title > </ ion-title >
7
- < ion-buttons right *ngIf ="person ">
7
+ < ion-buttons right *ngIf ="person && mobile ">
8
8
< button #create ion-button icon-only color ="primary " *ngIf ="person.isOwner() || person.isAdmin() || person.isAuthor() || person.isViewer() " (click) ="shareCheckin($event) ">
9
9
< ion-icon ios ="ios-share-outline " md ="md-share "> </ ion-icon >
10
10
</ button >
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ export class CheckinDetailsPage extends BasePage {
36
36
37
37
person :Person = null ;
38
38
39
+ modal :boolean = false ;
40
+
39
41
loading :boolean = false ;
40
42
41
43
constructor (
@@ -60,6 +62,7 @@ export class CheckinDetailsPage extends BasePage {
60
62
this . organization = this . getParameter < Organization > ( "organization" ) ;
61
63
this . checkin = this . getParameter < Checkin > ( "checkin" ) ;
62
64
this . person = this . getParameter < Person > ( "person" ) ;
65
+ this . modal = this . getParameter < boolean > ( "modal" ) ;
63
66
this . loadUpdates ( true ) ;
64
67
}
65
68
@@ -193,6 +196,10 @@ export class CheckinDetailsPage extends BasePage {
193
196
} ) ;
194
197
}
195
198
199
+ private closeModal ( event :any ) {
200
+ this . hideModal ( { } ) ;
201
+ }
202
+
196
203
private shareCheckin ( event :any ) {
197
204
let subject = this . checkin . message ;
198
205
let message = [ ] ;
Original file line number Diff line number Diff line change @@ -28,8 +28,6 @@ import { Notification } from '../../models/notification';
28
28
} )
29
29
export class CheckinListPage extends BasePage {
30
30
31
- LARGE_WIDTH :number = 992 ;
32
-
33
31
filter :string = "all" ;
34
32
organization :Organization = null ;
35
33
checkins :Checkin [ ] = [ ] ;
@@ -418,12 +416,23 @@ export class CheckinListPage extends BasePage {
418
416
}
419
417
420
418
private showCheckinDetails ( checkin :Checkin , event :any = null ) {
421
- this . showPage ( CheckinDetailsPage , {
422
- organization : this . organization ,
423
- person : this . person ,
424
- checkin : checkin ,
425
- checkin_id : checkin . id
426
- } ) ;
419
+ if ( this . platform . width ( ) > this . WIDTH_LARGE ) {
420
+ this . showModal ( CheckinDetailsPage , {
421
+ organization : this . organization ,
422
+ person : this . person ,
423
+ checkin : checkin ,
424
+ checkin_id : checkin . id ,
425
+ modal : true
426
+ } ) ;
427
+ }
428
+ else {
429
+ this . showPage ( CheckinDetailsPage , {
430
+ organization : this . organization ,
431
+ person : this . person ,
432
+ checkin : checkin ,
433
+ checkin_id : checkin . id
434
+ } ) ;
435
+ }
427
436
}
428
437
429
438
private sendReply ( checkin :Checkin , event :any = null ) {
Original file line number Diff line number Diff line change 1
1
< ion-header >
2
2
< ion-navbar color ="navbar ">
3
+ < ion-buttons left *ngIf ="modal == true ">
4
+ < button ion-button color ="primary " (click) ="hideModal($event) ">
5
+ Cancel
6
+ </ button >
7
+ </ ion-buttons >
3
8
< ion-title > </ ion-title >
4
9
< ion-buttons right *ngIf ="person ">
5
10
< button ion-button icon-only color ="primary " *ngIf ="person.isOwner() || person.isAdmin() " (click) ="editGroup($event) "> Edit</ button >
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export class GroupDetailsPage extends BasePage {
28
28
group :Group = null ;
29
29
person :Person = null ;
30
30
loading :boolean = false ;
31
+ modal :boolean = false ;
31
32
32
33
constructor (
33
34
protected zone :NgZone ,
@@ -50,6 +51,7 @@ export class GroupDetailsPage extends BasePage {
50
51
this . organization = this . getParameter < Organization > ( "organization" ) ;
51
52
this . person = this . getParameter < Person > ( "person" ) ;
52
53
this . group = this . getParameter < Group > ( "group" ) ;
54
+ this . modal = this . getParameter < boolean > ( "modal" ) ;
53
55
let loading = this . showLoading ( "Loading..." ) ;
54
56
this . loadGroup ( true ) . then ( loaded => {
55
57
loading . dismiss ( ) ;
Original file line number Diff line number Diff line change @@ -238,12 +238,23 @@ export class GroupListPage extends BasePage {
238
238
239
239
private showGroup ( group :Group ) {
240
240
this . logger . info ( this , "showGroup" , group ) ;
241
- this . showPage ( GroupDetailsPage , {
242
- organization : this . organization ,
243
- person : this . person ,
244
- group : group ,
245
- group_id : group . id
246
- } ) ;
241
+ if ( this . platform . width ( ) > this . WIDTH_LARGE ) {
242
+ this . showModal ( GroupDetailsPage , {
243
+ organization : this . organization ,
244
+ person : this . person ,
245
+ group : group ,
246
+ group_id : group . id ,
247
+ modal :true
248
+ } ) ;
249
+ }
250
+ else {
251
+ this . showPage ( GroupDetailsPage , {
252
+ organization : this . organization ,
253
+ person : this . person ,
254
+ group : group ,
255
+ group_id : group . id
256
+ } ) ;
257
+ }
247
258
}
248
259
249
260
}
Original file line number Diff line number Diff line change 1
1
< ion-header >
2
2
< ion-navbar color ="navbar ">
3
- < ion-buttons left *ngIf =" title " >
4
- < button ion-button icon-only menuToggle color ="primary ">
3
+ < ion-buttons left >
4
+ < button ion-button icon-only menuToggle *ngIf =" title " color ="primary ">
5
5
< ion-icon name ="menu "> </ ion-icon >
6
6
</ button >
7
+ < button ion-button color ="primary " *ngIf ="modal == true " (click) ="hideModal($event) ">
8
+ Cancel
9
+ </ button >
7
10
</ ion-buttons >
8
11
< ion-title > {{title}}</ ion-title >
9
12
< ion-buttons right *ngIf ="user && person ">
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export class PersonDetailsPage extends BasePage {
33
33
checkins :Checkin [ ] = [ ] ;
34
34
limit :number = 3 ;
35
35
offset :number = 0 ;
36
+ modal :boolean = false ;
36
37
37
38
constructor (
38
39
protected zone :NgZone ,
@@ -57,6 +58,7 @@ export class PersonDetailsPage extends BasePage {
57
58
this . person = this . getParameter < Person > ( "person" ) ;
58
59
this . user = this . getParameter < Person > ( "user" ) ;
59
60
this . title = this . getParameter < string > ( "title" ) ;
61
+ this . modal = this . getParameter < boolean > ( "modal" ) ;
60
62
let loading = this . showLoading ( "Loading..." ) ;
61
63
this . loadUpdates ( true ) . then ( ( loaded :any ) => {
62
64
loading . dismiss ( ) ;
Original file line number Diff line number Diff line change @@ -290,12 +290,23 @@ export class PersonListPage extends BasePage {
290
290
291
291
private showPerson ( person :Person , event :any = null ) {
292
292
this . logger . info ( this , "showPerson" ) ;
293
- this . showPage ( PersonDetailsPage , {
294
- organization : this . organization ,
295
- person : person ,
296
- user : this . person ,
297
- person_id : person . id
298
- } ) ;
293
+ if ( this . platform . width ( ) > this . WIDTH_LARGE ) {
294
+ this . showModal ( PersonDetailsPage , {
295
+ organization : this . organization ,
296
+ person : person ,
297
+ user : this . person ,
298
+ person_id : person . id ,
299
+ modal : true
300
+ } ) ;
301
+ }
302
+ else {
303
+ this . showPage ( PersonDetailsPage , {
304
+ organization : this . organization ,
305
+ person : person ,
306
+ user : this . person ,
307
+ person_id : person . id
308
+ } ) ;
309
+ }
299
310
}
300
311
301
312
private removePerson ( person :Person ) {
You can’t perform that action at this time.
0 commit comments