11import { Component , OnInit , OnDestroy , ElementRef } from '@angular/core' ;
2- import { NavParams , PopoverController } from 'ionic-angular' ;
2+ import { NavParams , PopoverController , ModalController } from 'ionic-angular' ;
33import { Chat , Message , MessageType , Location } from 'api/models' ;
44import { Messages } from 'api/collections' ;
55import { MeteorObservable } from 'meteor-rxjs' ;
@@ -9,6 +9,7 @@ import { MessagesOptionsComponent } from './messages-options';
99import { Subscription , Observable , Subscriber } from 'rxjs' ;
1010import { MessagesAttachmentsComponent } from './messages-attachments' ;
1111import { PictureService } from '../../services/picture' ;
12+ import { ShowPictureComponent } from './show-picture' ;
1213
1314@Component ( {
1415 selector : 'messages-page' ,
@@ -31,7 +32,8 @@ export class MessagesPage implements OnInit, OnDestroy {
3132 navParams : NavParams ,
3233 private el : ElementRef ,
3334 private popoverCtrl : PopoverController ,
34- private pictureService : PictureService
35+ private pictureService : PictureService ,
36+ private modalCtrl : ModalController
3537 ) {
3638 this . selectedChat = < Chat > navParams . get ( 'chat' ) ;
3739 this . title = this . selectedChat . title ;
@@ -266,4 +268,12 @@ export class MessagesPage implements OnInit, OnDestroy {
266268 zoom : Math . min ( splitted [ 2 ] || 0 , 19 )
267269 } ;
268270 }
271+
272+ showPicture ( { target } : Event ) {
273+ const modal = this . modalCtrl . create ( ShowPictureComponent , {
274+ pictureSrc : ( < HTMLImageElement > target ) . src
275+ } ) ;
276+
277+ modal . present ( ) ;
278+ }
269279}
0 commit comments