Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (2)
(fix): Re-set correct url when closing media modal after navigating
· 77c2ee0c
Emiliano Balbuena
authored
Jan 09, 2020
77c2ee0c
(fix): Set correct blog permalink
· 144389d7
Emiliano Balbuena
authored
Jan 09, 2020
144389d7
Hide whitespace changes
Inline
Side-by-side
src/app/modules/media/modal/modal.component.ts
View file @
144389d7
...
...
@@ -231,9 +231,6 @@ export class MediaModalComponent implements OnInit, OnDestroy {
if
(
!
this
.
nextEntity
)
{
this
.
nextEntity
=
next
;
}
console
.
log
(
'
prevEntity
'
,
this
.
prevEntity
);
console
.
log
(
'
nextEntity
'
,
this
.
nextEntity
);
}
load
()
{
...
...
@@ -336,6 +333,8 @@ export class MediaModalComponent implements OnInit, OnDestroy {
this
.
pageUrl
=
this
.
redirectUrl
;
}
else
if
(
this
.
contentType
===
'
rich-embed
'
)
{
this
.
pageUrl
=
`/newsfeed/
${
this
.
entity
.
guid
}
`
;
}
else
if
(
this
.
contentType
===
'
blog
'
)
{
this
.
pageUrl
=
`/
${
this
.
entity
.
ownerObj
.
username
}
/blog/
${
this
.
entity
.
slug
}
-
${
this
.
entity
.
guid
}
`
;
}
else
{
this
.
pageUrl
=
`/media/
${
this
.
entity
.
entity_guid
}
`
;
}
...
...
@@ -664,21 +663,23 @@ export class MediaModalComponent implements OnInit, OnDestroy {
goToNext
():
void
{
const
entity
=
this
.
nextEntity
;
entity
.
modal_source_url
=
this
.
entity
.
modal_source_url
||
''
;
this
.
prevEntity
=
this
.
originalEntity
;
this
.
nextEntity
=
null
;
this
.
setEntity
(
entity
/* , redirectUrl */
);
this
.
setEntity
(
entity
);
this
.
load
();
}
goToPrev
():
void
{
const
entity
=
this
.
prevEntity
;
entity
.
modal_source_url
=
this
.
entity
.
modal_source_url
||
''
;
this
.
prevEntity
=
null
;
this
.
nextEntity
=
this
.
originalEntity
;
this
.
setEntity
(
entity
/* , redirectUrl */
);
this
.
setEntity
(
entity
);
this
.
load
();
}
...
...