Skip to content

Commit 48f43fa

Browse files
committed
chore: sync with v4.3
2 parents bf936a9 + ed678c7 commit 48f43fa

File tree

7 files changed

+198
-95
lines changed

7 files changed

+198
-95
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "coreui-angular-dev",
33
"version": "4.2.27",
44
"description": "CoreUI Components Library for Angular",
5+
"copyright": "Copyright 2022 creativeLabs Łukasz Holeczek",
56
"license": "MIT",
67
"author": "The CoreUI Team (https://github.com/orgs/coreui/people)",
78
"scripts": {

projects/coreui-angular/src/lib/backdrop/backdrop.service.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,19 @@ export class BackdropService {
1414
private unListen!: () => void;
1515

1616
constructor(
17-
@Inject(DOCUMENT) private document: any,
17+
@Inject(DOCUMENT) private document: Document,
1818
private rendererFactory: RendererFactory2
1919
) {
2020
this.renderer = rendererFactory.createRenderer(null, null);
2121
}
2222

23+
get scrollbarWidth() {
24+
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
25+
const documentWidth = this.document.documentElement.clientWidth;
26+
const scrollbarWidth = Math.abs((window?.innerWidth ?? documentWidth) - documentWidth);
27+
return `${scrollbarWidth}px`;
28+
}
29+
2330
setBackdrop(type: string = 'modal'): any {
2431
const backdropElement = this.renderer.createElement('div');
2532
this.renderer.addClass(backdropElement, `${type}-backdrop`);

projects/coreui-angular/src/lib/modal/modal/modal.component.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,9 @@ export class ModalComponent implements OnInit, OnDestroy {
184184

185185
private _show = true;
186186

187-
private get scrollbarWidth() {
188-
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
189-
const documentWidth = this.document.documentElement.clientWidth;
190-
const scrollbarWidth = Math.abs((window?.innerWidth ?? documentWidth) - documentWidth);
191-
return `${scrollbarWidth}px`;
192-
}
193-
194187
@HostListener('@showHide.start', ['$event'])
195188
animateStart(event: AnimationEvent) {
196-
const scrollbarWidth = this.scrollbarWidth;
189+
const scrollbarWidth = this.backdropService.scrollbarWidth;
197190
if (event.toState === 'visible') {
198191
this.renderer.setStyle(this.document.body, 'overflow', 'hidden');
199192
this.renderer.setStyle(this.document.body, 'padding-right', scrollbarWidth);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:host {
2+
display: none;
3+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy