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
888
Issues
888
List
Boards
Labels
Service Desk
Milestones
Merge Requests
48
Merge Requests
48
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
Compare Revisions
325b52f69f84996370fccd4a885b71ea1f4a0951...eb5c7bd3f3e1cce4453dea9ea236ef093aa3a8f8
Source
eb5c7bd3f3e1cce4453dea9ea236ef093aa3a8f8
Select Git revision
...
Target
325b52f69f84996370fccd4a885b71ea1f4a0951
Select Git revision
Compare
Commits (2)
(fix): media modal blog route
· 4a3d0af6
Marcelo Rivera
authored
1 hour ago
4a3d0af6
(feat): redirect to respective entities' pages when on mobile
· eb5c7bd3
Marcelo Rivera
authored
55 minutes ago
eb5c7bd3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
modal.component.ts
src/app/modules/media/modal/modal.component.ts
+1
-1
tile.component.ts
src/app/modules/pro/channel/tiles/media/tile.component.ts
+23
-4
No files found.
src/app/modules/media/modal/modal.component.ts
View file @
eb5c7bd3
...
...
@@ -162,7 +162,7 @@ export class MediaModalComponent implements OnInit, OnDestroy {
if
(
this
.
redirectUrl
)
{
this
.
location
.
replaceState
(
this
.
redirectUrl
);
}
else
if
(
this
.
entityType
===
'
blog
'
)
{
this
.
location
.
replaceState
(
`/blog/
${
this
.
entity
.
slug
}
-
${
this
.
entity
.
guid
}
`
);
this
.
location
.
replaceState
(
`
${
this
.
session
.
getLoggedInUser
().
username
}
/blog/
${
this
.
entity
.
slug
}
-
${
this
.
entity
.
guid
}
`
);
}
else
{
this
.
location
.
replaceState
(
`/media/
${
this
.
entity
.
entity_guid
}
`
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/tiles/media/tile.component.ts
View file @
eb5c7bd3
import
{
ChangeDetectionStrategy
,
Component
,
ElementRef
,
HostListener
,
Input
,
ViewChild
}
from
'
@angular/core
'
;
import
{
ChangeDetectionStrategy
,
Component
,
ElementRef
,
Input
,
ViewChild
}
from
'
@angular/core
'
;
import
{
MediaModalComponent
,
MediaModalParams
}
from
"
../../../../media/modal/modal.component
"
;
import
{
FeaturesService
}
from
"
../../../../../services/features.service
"
;
import
{
OverlayModalService
}
from
"
../../../../../services/ux/overlay-modal
"
;
import
{
Router
}
from
"
@angular/router
"
;
import
toMockActivity
from
"
../../util/mock-activity
"
;
import
{
ProChannelService
}
from
"
../../channel.service
"
;
import
isMobile
from
"
../../../../../helpers/is-mobile
"
;
@
Component
({
selector
:
'
m-pro--channel-tile
'
,
...
...
@@ -67,13 +68,31 @@ export class ProTileComponent {
}
}
goToEntityPage
(
entity
:
any
)
{
switch
(
this
.
getType
(
entity
))
{
case
'
object:image
'
:
case
'
object:video
'
:
this
.
router
.
navigate
([
`/media/
${
entity
.
guid
}
`
]);
break
;
case
'
object:blog
'
:
let
url
=
`/blog/
${
this
.
entity
.
slug
}
-
${
this
.
entity
.
guid
}
`
;
if
(
!
window
.
Minds
.
pro
)
{
url
=
`
${
this
.
channelService
.
currentChannel
.
username
}
/
${
url
}
`
;
}
this
.
router
.
navigate
([
url
]);
break
;
}
}
showMediaModal
()
{
const
activity
=
toMockActivity
(
this
.
entity
,
this
.
entity
.
subtype
===
'
video
'
?
this
.
videoDimensions
:
null
);
if
(
this
.
featuresService
.
has
(
'
media-modal
'
))
{
// Mobile (not tablet) users go to media page instead of modal
// if (isMobile() && Math.min(screen.width, screen.height) < 768) {
// this.router.navigate([`/media/${this.entity.guid}`]);
// }
if
(
isMobile
()
&&
Math
.
min
(
screen
.
width
,
screen
.
height
)
<
768
)
{
this
.
goToEntityPage
(
this
.
entity
);
return
;
}
if
(
activity
.
custom_type
===
'
video
'
)
{
activity
.
custom_data
.
dimensions
=
this
.
videoDimensions
;
...
...
This diff is collapsed.
Click to expand it.