Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Frontend
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
400
Merge Requests
56
CI / CD
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
c8d26f1c
Commit
c8d26f1c
authored
18 minutes ago
by
Marcelo Rivera
Browse files
Options
Download
(fix): don't use document for accessing the topbar
parent
2d72a854
feat/homepage-redesign
1 merge request
!623
Homepage redesign
Pipeline
#98199059
running with stages
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
17 deletions
+45
-17
src/app/common/common.module.ts
View file @
c8d26f1c
...
...
@@ -125,6 +125,7 @@ import { ShadowboxSubmitButtonComponent } from './components/shadowbox-submit-bu
import
{
FormDescriptorComponent
}
from
'
./components/form-descriptor/form-descriptor.component
'
;
import
{
FormToastComponent
}
from
'
./components/form-toast/form-toast.component
'
;
import
{
SsoService
}
from
'
./services/sso.service
'
;
import
{
V2TopbarService
}
from
'
./layout/v2-topbar/v2-topbar.service
'
;
PlotlyModule
.
plotlyjs
=
PlotlyJS
;
...
...
@@ -403,6 +404,10 @@ PlotlyModule.plotlyjs = PlotlyJS;
useFactory
:
router
=>
new
RouterHistoryService
(
router
),
deps
:
[
Router
],
},
{
provide
:
V2TopbarService
,
useFactory
:
V2TopbarService
.
_
,
},
],
entryComponents
:
[
NotificationsToasterComponent
,
...
...
This diff is collapsed.
src/app/common/layout/v2-topbar/v2-topbar.component.html
View file @
c8d26f1c
...
...
@@ -33,7 +33,10 @@
</a>
</ng-template>
<div
class=
"m-v2-topbar__Top"
>
<div
class=
"m-v2-topbar__Top"
[class.m-v2-topbar__noBackground]=
"!showBackground"
>
<div
class=
"m-v2-topbar"
>
<div
class=
"m-v2-topbar__Container--left"
>
<nav
class=
"m-v2-topbar__Nav"
>
...
...
This diff is collapsed.
src/app/common/layout/v2-topbar/v2-topbar.component.ts
View file @
c8d26f1c
...
...
@@ -11,6 +11,7 @@ import { Session } from '../../../services/session';
import
{
DynamicHostDirective
}
from
'
../../directives/dynamic-host.directive
'
;
import
{
NotificationsToasterComponent
}
from
'
../../../modules/notifications/toaster.component
'
;
import
{
ThemeService
}
from
'
../../../common/services/theme.service
'
;
import
{
V2TopbarService
}
from
'
./v2-topbar.service
'
;
@
Component
({
selector
:
'
m-v2-topbar
'
,
...
...
@@ -21,6 +22,7 @@ export class V2TopbarComponent implements OnInit, OnDestroy {
minds
=
window
.
Minds
;
timeout
;
isTouchScreen
=
false
;
showBackground
:
boolean
=
true
;
@
ViewChild
(
DynamicHostDirective
,
{
static
:
true
})
notificationsToasterHost
:
DynamicHostDirective
;
...
...
@@ -32,12 +34,14 @@ export class V2TopbarComponent implements OnInit, OnDestroy {
protected
session
:
Session
,
protected
cd
:
ChangeDetectorRef
,
private
themeService
:
ThemeService
,
protected
componentFactoryResolver
:
ComponentFactoryResolver
protected
componentFactoryResolver
:
ComponentFactoryResolver
,
protected
topbarService
:
V2TopbarService
)
{}
ngOnInit
()
{
this
.
loadComponent
();
this
.
session
.
isLoggedIn
(()
=>
this
.
detectChanges
());
this
.
topbarService
.
setContainer
(
this
);
}
getCurrentUser
()
{
...
...
@@ -56,6 +60,11 @@ export class V2TopbarComponent implements OnInit, OnDestroy {
this
.
componentInstance
=
this
.
componentRef
.
instance
;
}
toggleBackground
(
value
:
boolean
)
{
this
.
showBackground
=
value
;
this
.
detectChanges
();
}
detectChanges
()
{
this
.
cd
.
markForCheck
();
this
.
cd
.
detectChanges
();
...
...
This diff is collapsed.
src/app/common/layout/v2-topbar/v2-topbar.service.ts
0 → 100644
View file @
c8d26f1c
import
{
V2TopbarComponent
}
from
'
./v2-topbar.component
'
;
export
class
V2TopbarService
{
private
container
:
V2TopbarComponent
;
static
_
()
{
return
new
V2TopbarService
();
}
setContainer
(
container
:
V2TopbarComponent
)
{
this
.
container
=
container
;
return
this
;
}
toggleBackground
(
value
:
boolean
)
{
if
(
this
.
container
)
{
this
.
container
.
toggleBackground
(
value
);
}
}
}
This diff is collapsed.
src/app/modules/homepage/homepage.component.ts
View file @
c8d26f1c
...
...
@@ -5,6 +5,7 @@ import { Router } from '@angular/router';
import
{
Navigation
as
NavigationService
}
from
'
../../services/navigation
'
;
import
{
LoginReferrerService
}
from
'
../../services/login-referrer.service
'
;
import
{
Session
}
from
'
../../services/session
'
;
import
{
V2TopbarService
}
from
'
../../common/layout/v2-topbar/v2-topbar.service
'
;
@
Component
({
selector
:
'
m-homepage
'
,
...
...
@@ -13,8 +14,6 @@ import { Session } from '../../services/session';
export
class
HomepageComponent
implements
OnInit
,
OnDestroy
{
readonly
cdnAssetsUrl
:
string
=
window
.
Minds
.
cdn_assets_url
;
topbar
:
HTMLElement
;
minds
=
window
.
Minds
;
flags
=
{
...
...
@@ -26,11 +25,10 @@ export class HomepageComponent implements OnInit, OnDestroy {
public
title
:
MindsTitle
,
public
router
:
Router
,
public
navigation
:
NavigationService
,
public
session
:
Session
,
private
loginReferrer
:
LoginReferrerService
,
p
ublic
session
:
Session
p
rivate
topbarService
:
V2TopbarService
)
{
this
.
topbar
=
document
.
querySelector
(
'
.m-v2-topbar__Top
'
);
this
.
title
.
setTitle
(
'
Minds Social Network
'
,
false
);
if
(
this
.
session
.
isLoggedIn
())
{
...
...
@@ -48,7 +46,7 @@ export class HomepageComponent implements OnInit, OnDestroy {
}
ngOnDestroy
()
{
this
.
to
ggleTopbarBackground
(
fals
e
);
this
.
to
pbarService
.
toggleBackground
(
tru
e
);
}
goToLoginPage
()
{
...
...
@@ -64,7 +62,7 @@ export class HomepageComponent implements OnInit, OnDestroy {
@
HostListener
(
'
window:resize
'
)
onResize
()
{
this
.
to
ggleTopbarBackground
(
window
.
innerWidth
>
640
);
this
.
to
pbarService
.
toggleBackground
(
window
.
innerWidth
<=
640
);
const
tick
:
HTMLSpanElement
=
document
.
querySelector
(
'
.m-marketing__imageUX > .m-marketing__imageTick
'
...
...
@@ -77,12 +75,4 @@ export class HomepageComponent implements OnInit, OnDestroy {
tick
.
classList
.
remove
(
'
m-marketing__imageTick--right
'
);
}
}
toggleTopbarBackground
(
value
:
boolean
)
{
if
(
value
)
{
this
.
topbar
.
classList
.
add
(
'
m-v2-topbar__noBackground
'
);
}
else
{
this
.
topbar
.
classList
.
remove
(
'
m-v2-topbar__noBackground
'
);
}
}
}
This diff is collapsed.
Please
register
or
sign in
to comment