Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
881
Issues
881
List
Boards
Labels
Service Desk
Milestones
Merge Requests
51
Merge Requests
51
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
342d9e3d
Commit
342d9e3d
authored
52 minutes ago
by
Emiliano Balbuena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(wip): Modal service with root element
parent
6e709649
epic/minds-pro
1 merge request
!507
WIP: (feat): Minds Pro (development branch) - Release 3
Pipeline
#78724959
passed with stages
in 48 minutes and 58 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
8 deletions
+28
-8
overlay-modal.component.scss
...mon/components/overlay-modal/overlay-modal.component.scss
+1
-1
overlay-modal.component.ts
...ommon/components/overlay-modal/overlay-modal.component.ts
+13
-4
channel.component.ts
src/app/modules/pro/channel/channel.component.ts
+3
-1
list-modal.component.ts
...pp/modules/pro/channel/list-modal/list-modal.component.ts
+5
-2
overlay-modal.ts
src/app/services/ux/overlay-modal.ts
+6
-0
No files found.
src/app/common/components/overlay-modal/overlay-modal.component.scss
View file @
342d9e3d
...
...
@@ -122,7 +122,7 @@
}
}
body
.m-overlay-modal--shown
{
.m-overlay-modal--shown
{
overflow
:
hidden
;
}
...
...
This diff is collapsed.
Click to expand it.
src/app/common/components/overlay-modal/overlay-modal.component.ts
View file @
342d9e3d
...
...
@@ -26,6 +26,7 @@ export class OverlayModalComponent implements AfterViewInit {
hidden
:
boolean
=
true
;
class
:
string
=
''
;
root
:
HTMLElement
;
@
ViewChild
(
DynamicHostDirective
,
{
static
:
true
})
private
host
:
DynamicHostDirective
;
...
...
@@ -41,6 +42,10 @@ export class OverlayModalComponent implements AfterViewInit {
)
{
}
ngAfterViewInit
()
{
if
(
!
this
.
root
&&
document
&&
document
.
body
)
{
this
.
root
=
document
.
body
;
}
this
.
service
.
setContainer
(
this
);
}
...
...
@@ -67,6 +72,10 @@ export class OverlayModalComponent implements AfterViewInit {
this
.
componentInstance
.
parent
=
this
.
modalElement
.
nativeElement
;
}
setRoot
(
root
:
HTMLElement
)
{
this
.
root
=
root
;
}
setData
(
data
)
{
if
(
!
this
.
componentInstance
)
{
return
;
...
...
@@ -91,16 +100,16 @@ export class OverlayModalComponent implements AfterViewInit {
this
.
hidden
=
false
;
if
(
document
&&
document
.
body
)
{
document
.
body
.
classList
.
add
(
'
m-overlay-modal--shown
'
);
if
(
this
.
root
)
{
this
.
root
.
classList
.
add
(
'
m-overlay-modal--shown
'
);
}
}
dismiss
()
{
this
.
hidden
=
true
;
if
(
document
&&
document
.
body
)
{
document
.
body
.
classList
.
remove
(
'
m-overlay-modal--shown
'
);
if
(
this
.
root
)
{
this
.
root
.
classList
.
remove
(
'
m-overlay-modal--shown
'
);
}
if
(
!
this
.
componentInstance
)
{
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/channel.component.ts
View file @
342d9e3d
...
...
@@ -94,7 +94,9 @@ export class ProChannelComponent implements OnInit, AfterViewInit, OnDestroy {
}
ngAfterViewInit
()
{
this
.
modalService
.
setContainer
(
this
.
overlayModal
);
this
.
modalService
.
setContainer
(
this
.
overlayModal
)
.
setRoot
(
this
.
element
.
nativeElement
);
}
listen
()
{
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/list-modal/list-modal.component.ts
View file @
342d9e3d
import
{
ChangeDetectionStrategy
,
ChangeDetectorRef
,
Component
,
Injector
,
ViewChild
}
from
'
@angular/core
'
;
import
{
ChangeDetectionStrategy
,
ChangeDetectorRef
,
Component
,
ElementRef
,
Injector
,
ViewChild
}
from
'
@angular/core
'
;
import
{
ProChannelService
}
from
'
../channel.service
'
;
import
{
FeedsService
}
from
'
../../../../common/services/feeds.service
'
;
import
{
ProContentModalComponent
}
from
'
../content-modal/modal.component
'
;
...
...
@@ -35,13 +35,16 @@ export class ProChannelListModal {
protected
channelService
:
ProChannelService
,
protected
feedsService
:
FeedsService
,
protected
modalService
:
OverlayModalService
,
protected
element
:
ElementRef
,
protected
cd
:
ChangeDetectorRef
,
protected
injector
:
Injector
,
)
{
}
ngAfterViewInit
()
{
this
.
modalService
.
setContainer
(
this
.
overlayModal
);
this
.
modalService
.
setContainer
(
this
.
overlayModal
)
.
setRoot
(
this
.
element
.
nativeElement
);
this
.
load
(
true
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/services/ux/overlay-modal.ts
View file @
342d9e3d
...
...
@@ -18,6 +18,12 @@ export class OverlayModalService {
return
this
;
}
setRoot
(
root
:
HTMLElement
)
{
this
.
container
.
setRoot
(
root
);
return
this
;
}
create
(
component
,
data
?,
opts
?,
injector
?:
Injector
)
{
if
(
!
this
.
container
)
{
throw
new
Error
(
'
Missing overlay container
'
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment