Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
luna
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
luna
Commits
9be49823
Commit
9be49823
authored
May 28, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改显示标题过长的问题
parent
af656442
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
nav.component.css
src/app/pages/control/control/controlnav/nav.component.css
+3
-2
nav.component.html
src/app/pages/control/control/controlnav/nav.component.html
+1
-1
pipes.ts
src/app/pipes/pipes.ts
+3
-1
truncatechars.pipe.ts
src/app/pipes/truncatechars.pipe.ts
+15
-0
No files found.
src/app/pages/control/control/controlnav/nav.component.css
View file @
9be49823
...
...
@@ -44,7 +44,8 @@
font-family
:
'Roboto'
,
sans-serif
;
font-size
:
13px
;
text-decoration
:
none
;
padding-left
:
24px
;
padding-left
:
12px
;
padding-right
:
14px
;
line-height
:
26px
;
cursor
:
default
;
width
:
115px
;
...
...
@@ -68,7 +69,7 @@
}
.tabs
ul
li
.active
span
{
padding-left
:
24
px
;
padding-left
:
12
px
;
line-height
:
26px
;
color
:
white
;
height
:
18px
;
...
...
src/app/pages/control/control/controlnav/nav.component.html
View file @
9be49823
...
...
@@ -7,7 +7,7 @@
<li
*
ngFor=
"let m of NavList.List;let i = index"
[
ngClass
]="{'
active
'
:i=
=NavList.Active,'disconnected':!m.connected,
'
hidden
'
:
m
.
closed
!=
false
}"
id=
"termnav-{{i}}"
(
click
)="
setActive
(
i
)"
(
dblclick
)="
m
.
edit=
true;setActive(i)"
>
<span
*
ngIf=
"!m.edit"
>
{{m.nick}}
</span>
<span
*
ngIf=
"!m.edit"
>
{{m.nick
| truncatechars:25
}}
</span>
<input
*
ngIf=
"m.edit"
[(
ngModel
)]="
m
.
nick
"
(
blur
)="
m
.
edit=
false"
(
keyup
.
enter
)="
m
.
edit=
false"
autofocus=
"true"
/>
<a
class=
"close"
(
click
)="
close
(
m
,
i
)"
>
×
</a>
</li>
...
...
src/app/pipes/pipes.ts
View file @
9be49823
import
{
TransPipe
}
from
'./trans.pipe'
;
import
{
UtcDatePipe
}
from
'./date.pipe'
;
import
{
TruncatecharsPipe
}
from
'./truncatechars.pipe'
;
export
const
Pipes
=
[
UtcDatePipe
,
TransPipe
TransPipe
,
TruncatecharsPipe
];
src/app/pipes/truncatechars.pipe.ts
0 → 100644
View file @
9be49823
import
{
Pipe
,
PipeTransform
}
from
'@angular/core'
;
@
Pipe
({
name
:
'truncatechars'
})
export
class
TruncatecharsPipe
implements
PipeTransform
{
transform
(
value
:
string
,
length
:
number
):
string
{
if
(
!
value
)
{
return
value
;
}
if
(
value
.
length
<
length
)
{
return
value
;
}
return
value
.
slice
(
0
,
length
)
+
'..'
;
}
}
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