Skip to content

Commit b5a8c7c

Browse files
authored
Merge pull request #2329 from dpalou/MOBILE-3351
MOBILE-3351 core: Display image viewer in fullscreen
2 parents fe76cec + 841ed8b commit b5a8c7c

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

src/core/emulator/providers/capture-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class CoreEmulatorCaptureHelperProvider {
9999
params.maxTime = options.duration * 1000;
100100
}
101101

102-
modal = this.modalCtrl.create('CoreEmulatorCaptureMediaPage', params);
102+
modal = this.modalCtrl.create('CoreEmulatorCaptureMediaPage', params, { cssClass: 'core-modal-fullscreen' });
103103
modal.present();
104104
modal.onDidDismiss((data: any, role: string) => {
105105
if (role == 'success') {

src/directives/format-text.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export class CoreFormatTextDirective implements OnChanges {
221221
anchor.addEventListener('click', (e: Event) => {
222222
e.preventDefault();
223223
e.stopPropagation();
224-
this.domUtils.viewImage(imgSrc, img.getAttribute('alt'), this.component, this.componentId);
224+
this.domUtils.viewImage(imgSrc, img.getAttribute('alt'), this.component, this.componentId, true);
225225
});
226226

227227
img.parentNode.appendChild(anchor);

src/providers/utils/dom.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,25 +1561,26 @@ export class CoreDomUtilsProvider {
15611561
}
15621562

15631563
/**
1564-
* View an image in a new page or modal.
1564+
* View an image in a modal.
15651565
*
15661566
* @param image URL of the image.
15671567
* @param title Title of the page or modal.
15681568
* @param component Component to link the image to if needed.
15691569
* @param componentId An ID to use in conjunction with the component.
1570+
* @param fullScreen Whether the modal should be full screen.
15701571
*/
1571-
viewImage(image: string, title?: string, component?: string, componentId?: string | number): void {
1572+
viewImage(image: string, title?: string, component?: string, componentId?: string | number, fullScreen?: boolean): void {
15721573
if (image) {
15731574
const params: any = {
1574-
title: title,
1575-
image: image,
1576-
component: component,
1577-
componentId: componentId
1578-
},
1579-
modal = this.modalCtrl.create('CoreViewerImagePage', params);
1575+
title: title,
1576+
image: image,
1577+
component: component,
1578+
componentId: componentId,
1579+
};
1580+
const options = fullScreen ? { cssClass: 'core-modal-fullscreen' } : {};
1581+
const modal = this.modalCtrl.create('CoreViewerImagePage', params, options);
15801582
modal.present();
15811583
}
1582-
15831584
}
15841585

15851586
/**

0 commit comments

Comments
 (0)