Skip to content
Snippets Groups Projects
Commit 408f7463 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #23981 TIME 1:40 detect the resizing of the window and check if the device...

FIX #23981 TIME 1:40 detect the resizing of the window and check if the device resolution has changed.
parent 5a4ced20
No related branches found
No related tags found
No related merge requests found
import { Component, ViewEncapsulation } from '@angular/core'; import { Component, HostListener, OnInit, ViewEncapsulation } from '@angular/core';
import { CookieService } from 'ngx-cookie-service'; import { CookieService } from 'ngx-cookie-service';
import { SignaturesContentService } from './service/signatures.service'; import { SignaturesContentService } from './service/signatures.service';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
...@@ -19,11 +19,12 @@ import { Platform } from '@ionic/angular'; ...@@ -19,11 +19,12 @@ import { Platform } from '@ionic/angular';
styleUrls: ['app.component.scss'] styleUrls: ['app.component.scss']
}) })
export class AppComponent { export class AppComponent implements OnInit {
isPortrait: boolean; isPortrait: boolean;
debugMode: boolean; debugMode: boolean;
showLeftContent: boolean = false; showLeftContent: boolean = false;
showRightContent: boolean = false; showRightContent: boolean = false;
constructor(private translate: TranslateService, constructor(private translate: TranslateService,
public http: HttpClient, public http: HttpClient,
public signaturesService: SignaturesContentService, public signaturesService: SignaturesContentService,
...@@ -53,8 +54,32 @@ export class AppComponent { ...@@ -53,8 +54,32 @@ export class AppComponent {
} }
test() { // The event listens for window resize and checks if the device resolution has changed
return true; @HostListener('window:resize', ['$event'])
onResize() {
if (window.matchMedia('(resolution: ' + window.devicePixelRatio + 'dppx)').matches) {
if (window.devicePixelRatio >= 1.25) {
this.signaturesService.mobileMode = true;
setTimeout(() => {
$('.right-menu-responsive').css('--max-width', 'none');
}, 0);
} else {
this.signaturesService.mobileMode = false;
}
}
}
ngOnInit(): void {
if (window.matchMedia('(resolution: ' + window.devicePixelRatio + 'dppx)').matches) {
if (window.devicePixelRatio >= 1.25) {
this.signaturesService.mobileMode = true;
setTimeout(() => {
$('.right-menu-responsive').css('--max-width', 'none');
}, 0);
} else {
this.signaturesService.mobileMode = false;
}
}
} }
allowedRoute() { allowedRoute() {
......
...@@ -78,7 +78,8 @@ export class SidebarComponent implements OnInit, AfterViewInit { ...@@ -78,7 +78,8 @@ export class SidebarComponent implements OnInit, AfterViewInit {
async openProfile() { async openProfile() {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: ProfileComponent, component: ProfileComponent,
cssClass: 'profileCss' cssClass: 'profileCss',
backdropDismiss: false
}); });
await modal.present(); await modal.present();
} }
......
...@@ -92,8 +92,14 @@ input:read-only { ...@@ -92,8 +92,14 @@ input:read-only {
} }
.profileCss { .profileCss {
--width: 40%; @media screen and (min-width: 768px) and (min-height: 768px) {
--height: 65%; --width: 56%;
--height: 600px
}
@media screen and (min-width: 768px) and (min-height: 600px) {
--width: 56%;
--height: 600px
}
} }
.aboutUsCss { .aboutUsCss {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment