Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchParapheur
Commits
76359765
Commit
76359765
authored
2 years ago
by
Hamza HRAMCHI
Browse files
Options
Downloads
Patches
Plain Diff
FIX #23980 TIME 1:30 add a resize detection and resolution change event
parent
5a4ced20
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/frontend/app/app.component.ts
+29
-4
29 additions, 4 deletions
src/frontend/app/app.component.ts
with
29 additions
and
4 deletions
src/frontend/app/app.component.ts
+
29
−
4
View file @
76359765
import
{
Component
,
ViewEncapsulation
}
from
'
@angular/core
'
;
import
{
Component
,
HostListener
,
OnInit
,
ViewEncapsulation
}
from
'
@angular/core
'
;
import
{
CookieService
}
from
'
ngx-cookie-service
'
;
import
{
SignaturesContentService
}
from
'
./service/signatures.service
'
;
import
{
HttpClient
}
from
'
@angular/common/http
'
;
...
...
@@ -19,11 +19,12 @@ import { Platform } from '@ionic/angular';
styleUrls
:
[
'
app.component.scss
'
]
})
export
class
AppComponent
{
export
class
AppComponent
implements
OnInit
{
isPortrait
:
boolean
;
debugMode
:
boolean
;
showLeftContent
:
boolean
=
false
;
showRightContent
:
boolean
=
false
;
constructor
(
private
translate
:
TranslateService
,
public
http
:
HttpClient
,
public
signaturesService
:
SignaturesContentService
,
...
...
@@ -53,8 +54,32 @@ export class AppComponent {
}
test
()
{
return
true
;
// The event listens for window resize and checks if the device resolution has changed
@
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
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment