Skip to content

Commit 841ed8b

Browse files
committed
MOBILE-3351 core: Display image viewer in fullscreen
1 parent 4f25af2 commit 841ed8b

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
@@ -1560,25 +1560,26 @@ export class CoreDomUtilsProvider {
15601560
}
15611561

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

15841585
/**

0 commit comments

Comments
 (0)