Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
syntax_j
mycard
Commits
23907a20
Commit
23907a20
authored
Sep 06, 2016
by
h3remi7
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add navbar click
parent
5e4d1e79
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
19 deletions
+43
-19
app/apps.component.html
app/apps.component.html
+2
-1
app/apps.component.ts
app/apps.component.ts
+6
-1
app/apps.service.ts
app/apps.service.ts
+7
-2
app/mycard.component.html
app/mycard.component.html
+8
-8
app/mycard.component.ts
app/mycard.component.ts
+20
-7
No files found.
app/apps.component.html
View file @
23907a20
...
...
@@ -4,7 +4,8 @@
<a href="#" class="list-group-item list-group-item-action">绯想天</a>
<a href="#" class="list-group-item list-group-item-action disabled">永远消失的幻想乡</a>
-->
<a
*ngFor=
"let app of appsService.data"
(click)=
"selectApp(app.id)"
<a
*ngFor=
"let app of appsService.data"
(click)=
"selectApp(app.id)"
href=
"#"
class=
"list-group-item list-group-item-action"
[ngClass]=
"{active: app.id==routingService.app}"
...
...
app/apps.component.ts
View file @
23907a20
...
...
@@ -10,7 +10,12 @@ import { RoutingService } from './routing.service'
export
class
AppsComponent
{
constructor
(
private
appsService
:
AppsService
,
private
routingService
:
RoutingService
)
{
appsService
.
getApps
();
appsService
.
getApps
(()
=>
{
console
.
log
(
appsService
.
data
)
if
(
appsService
.
data
.
length
>
0
)
{
this
.
selectApp
(
appsService
.
data
[
0
].
id
);
}
});
}
selectApp
(
id
)
{
...
...
app/apps.service.ts
View file @
23907a20
...
...
@@ -17,10 +17,15 @@ export class AppsService {
constructor
(
private
http
:
Http
)
{
}
getApps
()
{
getApps
(
callback
)
{
this
.
http
.
get
(
'
./apps.json
'
)
.
map
(
response
=>
response
.
json
())
.
subscribe
(
data
=>
{
console
.
log
(
data
);
this
.
data
=
data
});
.
subscribe
(
data
=>
{
this
.
data
=
data
if
(
typeof
(
callback
)
===
'
function
'
)
{
callback
();
}
});
}
...
...
app/mycard.component.html
View file @
23907a20
...
...
@@ -2,15 +2,15 @@
<a
class=
"navbar-brand"
href=
"#"
>
MyCard
</a>
<ul
class=
"nav navbar-nav"
>
<!--
<li class="nav-item">
<a class="nav-link" href="#">商店</a>
<li
[ngClass]="{active: routingService.component == 'store'}"
class="nav-item">
<a
(click)="changeFouce('store')"
class="nav-link" href="#">商店</a>
</li>
-->
<li
class=
"nav-item active
"
>
<a
class=
"nav-link"
href=
"#"
>
游戏
<span
class=
"sr-only"
>
(current)
</span></a>
<li
[ngClass]=
"{active: routingService.component == 'lobby'}"
class=
"nav-item
"
>
<a
(click)=
"changeFouce('lobby')"
class=
"nav-link"
href=
"#"
>
游戏
<span
class=
"sr-only"
>
(current)
</span></a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"#"
>
社区
</a>
<li
[ngClass]=
"{active: routingService.component == 'community'}"
class=
"nav-item"
>
<a
(click)=
"changeFouce('community')"
class=
"nav-link"
href=
"#"
>
社区
</a>
</li>
</ul>
<div
class=
"navbar-right"
>
...
...
@@ -19,8 +19,8 @@
<img
id=
"avatar"
src=
"https://ygobbs.com/letter_avatar_proxy/v2/letter/a/e47774/36.png"
alt=
"image"
>
</a>
<a
href=
"#forum"
class=
"require-login profile item"
id=
"username"
></a>
<a
href=
"#ygopro"
id=
"logout"
class=
"require-login item"
>
切换账号
</a>
<a
href=
"#ygopro"
id=
"refresh"
class=
"item"
>
刷新
</a>
<a
(click)=
"changeFouce('login');"
href=
"#ygopro"
id=
"logout"
class=
"require-login item"
>
切换账号
</a>
<a
(click)=
"refresh()"
href=
"#ygopro"
id=
"refresh"
class=
"item"
>
刷新
</a>
</div>
<div
id=
"window-buttons"
[class.darwin]=
"platform == 'darwin'"
>
<i
id=
"minimize"
class=
"fa fa-minus"
aria-hidden=
"true"
></i>
...
...
app/mycard.component.ts
View file @
23907a20
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
}
from
'
@angular/core
'
;
declare
var
process
;
import
{
RoutingService
}
from
'
./routing.service
'
;
declare
var
System
;
import
{
RoutingService
}
from
'
./routing.service
'
;
const
electron
=
System
.
_nodeRequire
(
'
electron
'
);
@
Component
({
selector
:
'
mycard
'
,
templateUrl
:
'
app/mycard.component.html
'
,
styleUrls
:
[
'
app/mycard.component.css
'
],
selector
:
'
mycard
'
,
templateUrl
:
'
app/mycard.component.html
'
,
styleUrls
:
[
'
app/mycard.component.css
'
],
})
export
class
MyCardComponent
{
platform
=
process
.
platform
;
constructor
(
private
routingService
:
RoutingService
)
{
}
platform
=
process
.
platform
;
constructor
(
private
routingService
:
RoutingService
)
{
}
changeFouce
(
component
)
{
this
.
routingService
.
component
=
component
;
}
refresh
()
{
electron
.
remote
.
getCurrentWindow
().
reload
()
}
}
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